. , .
: (). , , , . , . . -. - , ( , ..).
, . , , , , , , .. -, .. , , . , , , .
-68 APL. .
:
- () (Basic, Pascal, C .), ; ;
- (Prolog, Lisp .), , , ;
- - (Object Pascal, C#, Java .), , . - , , , . , .
1.3. ++
Bell Labs 1972 . UNIX. , . , .
. - ++ #. , Java, PHP4 .
. .
, , .. - , .
|
|
: .
. .. - , - .
, , .
. .
( - ).
++ . ++ .. . .OBJ. ( ). .EXE.
, , .
, , , .
.
.
, .
:
(A,B,C,...,Z,a,b,c,...,z)
(0,1,2,3,4,5,6,7,8,9)
" ' {} [] () | + - * / % \;.,:? < > _! & # ~ ^
(" "), , , .
. , , ( - "token).". :
- ;
- () ;
- ;
- ;
- ;
- ;
- (, , , ).
- , , , .
, , . :
1. ,
2. , - # $
3. , Name name
4.
ANSI 6 31 . ( extern) , , .
|
|
, , . , Square , , , s. AgeInYears, .. , . - age_in_years - .
, . , . C++ :
asm | else | new | this |
auto | enum | operator | throw |
bool | explicit | - private | true |
break | export | protected | try |
case | extern | public | typedef |
catch | false | register | typeid |
char | float | reinterpretcast | typename |
class | for | return | union |
const | friend | short | unsigned |
cohstcast | goto | signed | using |
continue | if | sizeof | virtual |
default | inline | static | void |
delete | int | staticcast | volatile |
do | long | struct | wchart |
double | mutable | switch | while |
dynamiccast | namespace | template |
:
:
char
double
enum
float
int
long
short
struct
signed
union
unsigned
void
typedef
:
const ,
volatile , .
:
auto
extern
register
static
:
break
continue
do
for
goto
if
return
switch
while
:
default
case
else
sizeof
,
\a \b \t \n \v \f \r \ \ \\ \ddd \xddd | A B C D 5C ddd |
, . . . .
:
[ ] () { } *,: =;... #
, . , (pound sign (#)) .
Operators - . :
[ ] (). -> ++ -- & * + - ~! sizeof / % << >> < > <= >= ==!= ^ | && ||?: = *= /= %= += -= <<= >>= &= ^= |=, # ##
|
|
. , , . , , 1.
, ,
, , | 8, 0,199226 | ||
, (0,1,2,3,4,5,6,7) | 01, 020, 07155 | ||
, (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F) | OxA, OxlB8, OXOOFF | ||
[] []2 | 5.7,.001,35. | ||
[][][]{;}[+;-][]3 | 0.2E6,.11e-3 510 | ||
, | ,', '\0', '\n', '\07' | ||
, | " Vasia" |
. ( ), 10. , , , .
, , char. int, .
, - NULL. "" - , .
(//) , - /* */. , C++, .
. : , , ; . .
, . , , - . . . , . ( , ) . . , .
, . , - . - . .
. . ,
|
|
-. , , .
:
- ;
, ;
- , .
, , . . , .
() , . :
- int ();
- char ();
- wchar_t ( );
- bool ();
- float ();
- double ( ).
(), . ,
, .
, :
- short ();
- long ();
- signed ();
- unsigned ().
.. | () | |
bool | true false | |
signed char | -128...127 | |
unsigned char | 0...255 | |
signed short int | -32 768... 32 767 | |
unsigned short int | 0... 65 535 | |
signed long int | -2 147 483 648... 2 147 483 647 | |
unsigned long int | 0... 4 294 967 295 | |
float | 3.4-38... 3.4+38 | |
double | 1.7-308... 1.7+308 | |
long double | 3.4-4932... .4+4932 |
(int)
int , . 16- 2 , 32- 4 .,
short , 2 . long , 4 . , 16- 1nt short 1nt, 32- int long int.
signed unsigned . , . unsigned, . signed, . signed. signed unsigned . . signed int unsigned int.
short int, long int, signed int unsigned int short, long, signed unsigned .
(char)
, , . , 1 . char, , . -128 127. unsigned 0 255. 256- ASCII. char , .
C++ : float, double long double.
, . . IBM PC- float 4 , , 8 23 . , 1.0, 2.0. 1, .
double, 8 , 11 52 . , . , , float long int, - .
|
|
long double , 10 .
double
void
, void, . , , (,