ORIGINAL CODE STRIPPED TO BARE MINIMUM: char get_credit (void) { char test_string[]=3D"Your balance is =A34.38."; char *pnd_point; char *dec_point; int length; strcpy (rx_array,test_string); pnd_point =3Dstrchr (rx_array,'=A3'); dec_point =3Dstrchr (rx_array,0x2E); length =3D(pnd_point - dec_point); // line 244 } First: It _is_ perfectly legal to subtract one pointer from another in ANSI = "C", if: 1) The two pointers are pointers to the same type, and 2) They both both into, or just beyond, the same array. You have met both conditions. However, I am sure you made a mistake: 'dec_point' will be greater than = 'pnd_point', so when you do your subtraction you will get 'length=3D-2". I = am = guessing that perhaps this is your issue, but I am not sure how the compile= r = could tell. Alternatively, you may have a broken compiler that just doesn't understand = pointer subtraction. This should work, and be quite efficient credit_pnd =3D 0; credit_pence =3D 0; char const *p =3D strchr(rx_array,'=A3'); while ( *p !=3D '.' ) { credit_pnd *=3D 10; credit_pnd +=3D *p - '0'; ++p; } ++p; while ( *p !=3D 0 ) { credit_pence *=3D 10; credit_pence +=3D *p - '0'; ++p; } Alternatively: pnd_point =3Dstrchr (rx_array,'=A3'); dec_point =3Dstrchr (rx_array,0x2E); *dec_point =3D 0; credit_pnd =3D atoi( pnd_point+1); credit_pence =3D atoi(dec_point+1); Or even: char *p; p =3D strchr(rx_array,0x2E); credit_pence =3D atoi(p+1); *p=3D0; p =3D strchr(rx_array,'=A3'); credit_pnd =3D atoi(p+1); [ you can reuse the pointer variable ] --- Bob Ammerman RAm Systems -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist