Jan 17, 2009

char c[] = "abc\012\0x34";

char c[] = "abc\012\0x34";
length of c is 8
sizeof c is 9 (8+’\0’)
a
b
c
\012 (oct)
\0
X
3
4
The output is “abc “, because \012 is empty and \0 is a terminator.

No comments:

Post a Comment