Home > Back-end >  Character array output problem
Character array output problem

Time:12-16

#include
Int main (void)
{
Char [b]="the program";
Printf (" % s ", b + 1);
return 0;
}
Why the output is not b [1], that is, r, but rogram,

CodePudding user response:

Because you use % s output, change to output is the r % c

CodePudding user response:

Please refer to the c + + "printf () function USES 10-2"
Wish I could help you!

CodePudding user response:

B first address that points to a character array & amp; B [0], b + 1 points to the second address of the characters, r, and led by % s output r address of a string of characters, upstairs answer is positive solution,
  • Related