Home > Back-end > C language character in the variable assignment problem
C language character in the variable assignment problem
Time:09-19
For example: char p='abcd'; Printf (" p=% c ", p) Why you can print out the p value of d Again if it is char p='abcde'; Printf (" p=% c ", p) That could go wrong said p behind the assignment is too big (more than four characters)
CodePudding user response:
Have a great god explain, today suddenly run into this type of problem
CodePudding user response:
1. % c is output character 2. "this symbol is a single character, a, b, c, d, e is one character at a time, but if together, is a string, value should be attached with char * p or char p [5]
CodePudding user response:
This problem is more error, the string should use ", "character in single quotes, double quotes frames string represents the address,