\0 Null Terminator

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PlayOS

\0 Null Terminator

Post 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.
Post Reply