Some review of Chapter III

C ++ provides a range beyond what measures to prevent integer?

A: did not, if necessary, to use the header file climits be limited.

 

The following two lines of C ++ statements are equivalent?

char grade = 65;
char grade = 'A';

A: not really equivalent, although for some systems, they are equivalent. Importantly, only then use the ASCII code system,

  The first statement before the "score" is set to the letter A, while the second statement may also be used with other encoding systems. Second, it is a 65

  int constant, and 'A' is a constant char.

 

The method of two or more characters 88 printed coded representation.

answer:

char c = 88;

cout << c << endl;    //char type prints as character
cout << char(88) << endl;    //new type cast value to char
cout << (char)88 << endl;    //old tyoe cast value to char
cout.put(char(88));                //put() prints char as character

 

Guess you like

Origin www.cnblogs.com/Charons/p/11291505.html