- - , . .
. , , , (, , ..). , .
.., (, ), , . , .
-
. , , , , - . , , , .
, :, - , ;Simula, - ;, - .
: , , .. IBM, /1. -68. , , . /1 , , , . . .
- , .
. , ( ) . , .
|
|
.
. . .
, , ( ), .
, , , - . , , - .
5. C++
( "") 70 Bell Telephone Laboratories UNIX. C B (""), , BCPL. BCPL 1967 . B Unix Bell Laboratories 1970 DEC PDP-7. BCPL B - "" , , , .
1978 . " " ( Prentice-Hall) "K & R". ( " ").
C ( ) , , . , . , , . , C. 1983. ANSI ( ) X3J11 C ( " - "). 1989 . ANSI ISO ( ), C ; 1990 ANSI/ISO 9899:1990. .
++ . " C++, . C++, C++, - . - C++ C, C C++ ( C++ C). C, , . C, , BCPL; , // C++ BCPL. Simula67. ( ) . , , Algol68.
|
|
C++ . C. "++" - C. C+ ; , . C , C++ , ++C. D , C ... C++ , , C . . C++ ; , . , C++ C++. " C++" " C++". C++ , , , ".
C.
C . , , ++ --.
C , , .. C ( ), .
C . , . , , . , .
, C . , , . .
C, . /, , .., C , .
6. C++, ,
bool | 1 | false, true | |
(signed) char | 1 | 128 127 | |
wchar_t | 2 | Unicode | 0 65535 |
(signed) short int | 2 | -32768 32767 | |
(signed) int | ( 4 ) | ||
(signed) long int | 4 | -2147483648 2147483647 | |
(signed) long long int (signed) __int64 (MS) | 8 | 9,223,372,036,854,775,808 9,223,372,036,854,775,807 | |
unsigned char | 1 | 0 255 | |
unsigned short int | 2 | 0 65535 | |
unsigned int | ( 4 ) | ||
unsigned long int | 4 | 0 4294967295 | |
(unsigned) long long int (unsigned) __int64 (MS) | 8 | 0 18,446,744,073,709,551,615 | |
float | 4 | 1.175494351e38 3.402823466e+38 | |
double | 8 | 2.2250738585072014e308 1.7976931348623158e+308 | |
long double |
C++ enum, , void, . , , void. .
|
|
++ .
C++ , .
. , 0 , . ++ . , true 1 , false 0. , : true, false. , , . , .
, true, false.
C++
- :: . . , . , .
- () ( ) .
- [ ] , .
- . -> , , .
- static_cast ( ), dynamic_cast ( ), reinterpret_cast ( ), const_cast ( ) . : < >(). . static_cast , , , . reinterpret_cast , , () . static_cast, , reinterpret_cast. dynamic_cast . const_cast const.
- - .
- ~ (. 8).
- ! .
- * (. 5).
- & (. 5).
- ++ -- ( 1) ( 1) . , . ( ), ( ). , , . , . , , . , i = 0, a[++i] = 1 a[1], a[i++] = 1 a[0]. i , 1.
- sizeof .
- : (< >)< >. , (long int)n n long int. , / . static_cast, dynamic_cast, reinterpret_cast const_cast.
- % .
- C++ . : < 1 >? < 2 >: < 3 >. < 1 > , < 2 > . < 1 > , < 3 > . , < 2 > < 3 >, .
- . =. . , . . , a = b = c = 0 0, a = (b = 3) + (c = 5) c 5, b 3, a 8.
- . , - . , , . n += 5 n = n + 5, .
- , , . , , , .
|
|