Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Ask a C++ question, why does the following program output a smiling face?
Ask a C++ question, why does the following program output a smiling face?
V is defined as a character variable by you, and when the variable V is output by cout, it will output the character form of V; Different values correspond to different characters, and the character corresponding to the value of 1 is a smiling face.

What you don't understand should be why you don't output 1 At this time, you need to define V as an int type or an unsigned int type, and cout will automatically output the value of the plastic variable V as "1".

Char variable can also output 1, and V can be initialized with'1'. That is, the unsigned character v ='1'; If yes, you can output "1".

I hope this will help you a little.