All Questions
2 questions
7
votes
6
answers
14k
views
What if a null character is present in the middle of a string?
I understand that the end of a string is indicated by a null character, but i cannot understand the output of the following code.
#include <stdio.h>
#include <string.h>
int
main(void)
{
...
0
votes
2
answers
818
views
strlen sometimes equal to sizeof for null-terminated strings
I know that strlen counts the number of characters up until (and excluding) the null character '\0' (or 0) and that sizeof gives the amount of space needed to store the string including the null ...