.


:




:

































 

 

 

 





1. .. Microsoft Visual C++ Turbo C++ Explorer ( ..).- : , 2007. 325.

2. .. /++. . .: , 2003. 461.


 

++

1972 UNIX.

, .

( ).

, .

.

, , , , , , , ..

. , , .

1.

: , , , .

:

, , .

, , .

.

. .

.

.

.

.

. .

, [1], .

, , .

.

, , , .

, .

:

, ;

0 9;

:

{ }, |, [ ] () + / % *. \ :? < = >! & # ~; ^

, .

 

, . , .

. , . :

ABC, abc, Abc .

. . , , .. .

, . // :

//

:

/* */

- . .

:

;

, ;

, .

.

 

.

.

:

char ,

int ,

float ,

double ,

bool ,

void ().

[2]:

short ;

long ;

signed ;

unsigned .

 

1.5.1. (char)

, . , 1.

char 128127 1
unsigned char 0255 1
signed char 128127 1

1.5.2. (int)

int . 16- 2 , 32- 4 .

short , 2 .

long , 4 .

, .. signed .

int -3276732767 2 4
unsigned int 065535 ---
signed int -3276732767 ---
short int -3276732767 2
long int -2147483647 4
unsigned short int 065535 2
signed short int -3276732767 2
long long int (2631) (2631) 8
signed long int -2147483647 4
unsigned long int 0 4
unsigned long long int 0 2641 8

 


1.5.3.

(float, double)

.

mEp, m ( ), p ( ).

, .

,

-6.42+2 = -6.42.102 = -642,

3.2E-6 = 3.2.10-6 =0.0000032

float 3.4-383.4E+38 4
double 1.7-3081.7E+308 8
long double 3.4-49323.4E+4932 10

bool true () false (). true, 1. false 0.

1.5.5. void

. , , , .

1.6. ++

, .

() .

, .

.

:

_;

,

int a, bc, f;

float g, u, h12;

: , , , , .

:

( ),

( ),

( ).

1.7. ++

, . :

onst =;

, , .

, , :

const double pi=3.14159

. #define:

#define PI 3.141592653

int main()

{

(, , ), :

a+b*sin(cos(x)).

(-)

(+b).

++

++ 1
-- 1
~
!
- ( )
+
&
*
(type)
+
-
*
/
%
<<
>>
<
>
<=
>=
==
!=
& ()
^
| ()
&&
||
=
*=
/=
+=
-=
%=
<<=
>>=
&=
|=
^=
?:
,
sizeof
()
     

:

_=;

, , .

.

, , .

, a=b , b.

a b , : . , .

++ . :

1=2==N=;

a=b=c=3.14159/6;

+=, =, *=, /= .

.

:

x+=p; // x p,

// x=x+p.

x-=p; // x p,

// x=x-p.

x*=p; // x p,

// x=x*p.

x/=p; // x p,

// x=x/p.

+, -, *, / . .

++ -- , .

( ),

( ).

,

p=p+1; ++p; p++;

() , () , .

,

x=12;

y=++x; // y

//

// 13.

() , , () :

x=12;

y=x++; //

// 12 y.

/ ( ) , :

11/4=2 11.0/4=2.75.

% : 11%4 = 3.





:


: 2016-11-12; !; : 820 |


:

:

,
==> ...

1832 - | 1816 -


© 2015-2024 lektsii.org - -

: 0.055 .