'\0' is zero character. In C it is mostly used to indicate the termination of a character string. Of course it is a regular character and may be used as such but this is rarely the case. your string is automatically add the null-terminated(or ends with \0 ) at the end of string, but you add no effect on code.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
'\0' is zero character. In C it is mostly used to indicate the termination of a character string. Of course it is a regular character and may be used as such but this is rarely the case. your string is automatically add the null-terminated(or ends with \0 ) at the end of string, but you add no effect on code.
Should I put '\0' in my C strings?