And characters' Among these are not things exactly is of a few bytes,
CodePudding user response:
If it is not wide byte character, accounting for one character (string terminator) 8 bytes Characters', too, although there is nothing, but with one character 8 bytes to store Of course, if is C, and the character constants, four characters of 32 bytes (C int character constants used to store, that is why the return value is an int) getchar
CodePudding user response:
# include & lt; stdio.h> #include Int main () { Int v. Char s [3]={' A ', 'B', '\ 0'};
Printf (" 0 x % 02 x x % 0 02 x x % 0 02 x \ n ", (unsigned char) s [0], (unsigned char) s [1], (unsigned char) s [2]);//0 x41 x42 0 0 x00
Strcpy (s, "");
Printf (" 0 x % 02 x x % 0 02 x x % 0 02 x \ n ", (unsigned char) s [0], (unsigned char) s [1], (unsigned char) s [2]);//0 x00 to 0 x42 0 x00
V=strlen (" ") + 1; Printf (" % d \ n ", v);//1
//v=sizeof (");//VS2015 compile error error C2137: empty character constants V=sizeof ("); Printf (" % d \ n ", v);//1 return 0; }