--- Dave Lippincott wrote: > even easier... > string[strlen(string)-1] = '\0'; > Your method could over-bound the string and blow up if the '\n' is > missing. >
I think he meant the original string had no '\0' at the end, only a '\n'. If so, your suggestion would not work. His example was: e.g. "00000103\n" -> "00000103\0" If he meant the source string was '0','0','0','0','0','1','0','3','\n' then it won't work, but if he meant it was '0','0','0','0','0','1','0','3','\n','\0' then he could use string[StrLen(string)-1] = '\0'; It's often difficult to tell what anyone means when they say "string" because C has no string data type -- it just has pointers. __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
