2.7 Explains the differences between the following literal constants
(a) ' A ', l ' a ', ' a ', l ' a '
(b) 10u, 10L, 10uL, 012, 0xC
(c) 3.14, 3.14f, 3.14L
(1) ' A ' means that the character a;l ' a ' denotes a wide character literal; " A "represents the letter A and the null character of the two-character string; L" a "denotes wide character literals A and null characters.
(2) 10 is an integer type 10,10u is an unsigned 10,10l for a long shape 10,10ul is an unsigned long integer 10,012 is an octal 10,0xc of 16 binary 10.
(3) 3.14 for floating-point double precision 3.14,3.14f is a floating-point single-precision 3.14,3.14l of 3.14 of the floating-point extension precision.
2.8 Determines the type of the following literal constants:
(a) -10 (b) -10u (c)-10. (d) -10e-2
(a) int type, (b) unsigned int (c) double type (d) Double type
Note:-10. The following. Represents a decimal, so is the double type -10e-2 is the scientific notation, i.e.-0.1, so is the double type?
2.9 which (if any) of the following are illegal?
(a) "who goes with f\145rgus?\012"
(b) 3.14e1l
(c) "Some" and "L"
(d) 1024f (e) 3.14UL
(f) "Multiple line comment"
(a) and (d)
2.10 writes a program with an escape character, outputs 2M, and then wraps. Modify the program, Output 2, followed by a tab, then M, and finally the newline character.
#include <iostream>int main () { "" << Std::endl; GetChar (); return 0 ;}
#include <iostream>int main () { "" << Std::endl; GetChar (); return 0 ;}
C + + PREMIER second-class title