Int main ()
{
Char num_max=255;
Printf (" num_max=% d \ n ", num_max);
return 0;
}
Compile run results: num_max=1
The second question: why to % s output will have one more letter
# include & lt; stdio.h>
# include & lt; Stdlib. H>
Int main ()
{
Char STR [5]="apple";
STR: printf (" % s \ n ", STR);
return 0;
}
Compile run results: apple F
CodePudding user response:
The firstPrintf (" num_max=% u \ n ", num_max);
The second
Char STR [6]="apple";
CodePudding user response:
The first data overflow, into 1The second string array is the last '\ 0'