My notes

xiaoxiao2021-03-06  45

1. About Switch. The left {after Switch can define the statement, but will never perform #include using namespace std; int main () {

INT i = 10, J = 1; Switch (i) {j = 30; // This statement does not perform CASE 10: cout << j;}; return 0;} 2. STATIC inside the function indicates that the variable remains continuing between each call between functions. This function is only visible to this file. 3. Output 16 binding and 8-way forms #include int Main Void) {int x = 100; Printf ("DEC =% D; Octal =% O; HEX =% x / n", x, x, x); Printf ("DEC =% D; Octal =% # O; HEX =% # x / n ", x, x, x); return 0;}

Compiling and Running this Program Products this Output:

Dec = 100; Octal = 144; HEX = 0x64

DEC = 100; Octal = 0144; HEX = 0x644./ Use #include

Int main (void)

{

Printf ("Here's One Way To Print A);

Printf ("long String./N");

Printf ("Here's Another Way To Print A /

Long String./N ");

Printf ("Here's The Newest Way To Print A"

"long string./n"); / * ANSI C * /

Return 0;

}

Here Is The Output: Here's One Way To Print A Long String.

Here's Another Way To Print A Long String.

Here's The Newest Way to Print A Long String.5. About Scanf ("% D", & IA); SCANF function attempts to accept the first non-air and change float or ' ', '-' symbol, saved to IA, but if it is not digital, such as: a The A will be put back into the input stream. Then the value of IA randomly 6. Remove spaces (using scanf functions) #include int main () {char s [] = "abc"; CHAR S1 [40]; SSCANF (S, "% s", S1); Printf ("% send / n", s1); return 0;} 7. Character string

Char * str1 = "hello";

Char * str2 = "hello";

* STR1 = 'P';

Cout << str2 << Endl;

转载请注明原文地址:https://www.9cbs.com/read-79463.html

New Post(0)