.
C++ : 1) ; 2) 9; 3) ; 4) : , , .
: 1); 2) () ; 3) ; 4); 5) (, , , ).
, ,
.
.
. , . , . . . , .
: 1) ; 2) ; 3) , , .
.
, . , . C++ . 1.1.
.
, . . , . - . [ ], () ?: . 1.2.
4.1.
++
asm auto bool break case catch char class const const_cast continue default delete do double dynamic_cast | else enum explicit export extern false float for friend goto if inline int long mutable namespace | new operator private protected public register reinterpret_cast return short signed sizeof static static__cast struct switch template | this throw true try typedef typeid typename union unsigned using virtual void volatile wchar_t while |
4.2.
, : | |
+ | |
- | |
* | |
/ | ( ) |
% | |
<< | |
>> | |
< | |
<= | |
> | |
>= | |
== | |
!= | |
&& | |
|| | |
& | |
* | |
- | |
+ | |
! | |
++ | 1 |
- - | 1 |
sizeof |
.
|
|
. , , . , , .
, (-), : -218,-022, -, -4.8, -0.14.
. ( ), . 10. , , , .
, , char. int, ( ).
:
, (, \ , \ );
('), (\), (?) ();
, , \073, \0xF5. 255.
, , , escape-. . , .
, . , , , , :
" \"\"" |
. , , . , , . , .
, . . , . . . :
|
|
int ; float ; |
:
[ ] [const] []; |
: 1) auto, extern, static register; 2) const , . , ; 3) , . :
= : (). |
. , .
:
short int = 1; // const char = ' ; // char s. sf = 'f'; // sf char t (54); float = 0.22. x(3). sum; |
, .
, , . , .
, . .
(, ), , , .
, , , .
( , ). , .
( ) ( ).
, . . , . , .
:
auto . , . , . . , , .
extern , ( ). , , i. .
static . . , . . , .
register auto, . , auto.
|
|
, . . (, ).
.
, , , . C++ . , , , .
.
() , . : 1) int (); 2) char (); 3) wchar_t ( ); 4) bool (); 5) float (); 6) double ( ).
(), . , , .
, : 1) short (); 2) long (); 3) signed (); 4) unsigned ().
1) (int)
int , . 16 2 , 32- 4 . short , 2 .
long , 4 . , 16- int short int, 32- int long int.
. signed ( , 1 ).
unsigned , . , int .
, signed . , , . - , L, l (long) U, u (unsigned). , 32L long 4 . L U , , Ox22UL 05LU.
2) (char)
, , . , 1 . char, , . -128 127. unsigned 255. 256- ASCH. char , .
|
|
3) (wchar_t)
wchar_t , 1 , , Unicode. ; , short. wchar_t L, , L"Gates".
4) (bool)
true false, . false (). true. true 1.
5) (float, double long double)
C++ : float, double long double. , . . IBM PC- float 4 , , 8 23 . , 1.0, 2.0. 1, .
double, 8 , 11 52 . , . . 1.4, , float long int, - .
long double , 10 . double. F, f (float) L, 1 (long). , 2E+6L long double, 1.82f float.
, , [1, 3]. [2, 4,5,6,7,8].
.
:
) :
1. , . C/C++ . : 2012.
2. . . - ++. : 2013. : -.
) :
3. . - ++.
4. .., .. ++: - . I. ++. - : , 2012. - 490 .
5. ., .. : . . .: , 2014. 908 .: .
6. . C++: . . .: , 2013. 699 .
7. .. ++: .
8. .., .. C++. . - .: (), 2015. - 48 .