Page 1 of 1

\0 Null Terminator

Posted: Thu Oct 24, 2002 7:17 am
by PlayOS
Hi,

just wondering if gcc supports the '\0' inside of a string, I have just written my strlen() function and when I try a string that has no '\0' in it, the function works perfectly, however if I embed this control code in the string the function acts as if there is no '\0' and it reports to the true length of the string - 1. Any ideas?

The function is just a standard loop that searches out the 0 that terminates the string, and counts every character until it finds it.

thanks.