2.2
\b | |
\n | |
\r | |
\f | |
\" | |
\' | |
\0 | - |
\t | |
\v | |
\a | |
\ \ | |
\? |
. .
- . , . . . , a, b, x, summa, Summa, Y_2345 ( ++ ).
. , , .., . :
- ;
- ;
- , , .
- , . , . 2.3 ++ .
2.3 ++
asm | do | if | return | typedef |
auto | double | inline | short | typeid |
bool | dynamic _ cast | int | signed | typename |
break | else | long | sizeof | union |
case | enum | mutable | static | unsigned |
catch | explicit | namespace | static_cast | using |
char | export | new | struct | virtual |
class | extern | operator | switch | void |
const | false | private | template | volatile |
const_cast | float | protected | this | wchar_t |
continue | for | public | throw | while |
default | friend | register | true |
- , . . C++ :
1. / * , * /. . :
#include <iostream. h> /*
iostream. h */
2. // , :
int a = 17; //
3. ++
|
|
. , , . , , . . , , .
:
1. ( );
2. ( ).
, , , . , . , .
, , . ++ .
++ ( ) . , , . . , , , , , .
C++ , . :
bool ();
char ();
int ();
float ();
double ( ).
, :
short ();
long ();
signed ();
unsigned ().
14 . , char, signed char unsigned char - .
++ .
. true false ( ), . . true 1, false - 0. .
. ++ : char, signed char unsigned char. - . - :
sizeof(char) = sizeof(signed char) = sizeof(unsigned char) = 1.
, , . char : signed char, unsigned char.
, , , .
|
|
. ++ 8 : (signed char, short int, int, long int) (unsigned char, unsigned short int, unsigned int, unsigned long int). , signed . unsigned . 2.4.
2.4 ++
short int | 2 | 0.... 65535=216-1 | -215...215-1=-327678... 32767 |
int | 4 | 0.... 4294967295 = 232-1 | -231... 231-1 |
long int | 4 | 0.... 4294967295 = 232-1 | -231... 231-1 |
. , 123.5, 3.14, 0.95.
123.5 , , , 10-. , 123.5 *100 = 12.35 * 101 = 1.235 * 102 = 1235 * 10-1.
++ 10 :
123.50 = 12.351 = 1.2352 = 1235-1.
. ++ : float , double - , long double . 2.5.
2.5 ++
float | 4 | -231... 231-1 |
double | 8 | -263... 263-1 |
long double | 8 | -263... 263-1 |
4. C++
. , .
, . A z ( ), 0 9 . , . ++ , . ++ , , Sum sum .
: