.


:




:

































 

 

 

 





 

, . :

. , , . , , ( ).

, . , . , , ::. .

. , . , .

. , () .

. , ( ) . .

. , , , , .

( )

. , .

, , :

struct Node{

int Node;

int i;

} Node;

, , .

, :

, , , (typedef) . , , ;

, , . ;

, . , ;

.

. , , static.

, , , extern. - . , , , . extern : , extern .

.

: n. two.cpp my_header. h:

my_header.h -

extern int ;

extern double b;

n.

#include "my_header.h"

int a;

two.cpp

#include "my_header.h"

double b;

n. two.cpp.

- , , . , , , .

( )

namespace.

:

namespace [ _ ]{ /* */ }

, , .

. - .

#include .

( , ), ( , , . , , . , .

static ( , ). , ( ).

, . .

:

namespace demo{

int i = 1;

int k = 0;

void funcl(int);

void func2(int) { /*... */ }

}

namespace demo{ //

int i = 2; // -

void func1(double); //

void func2(int); // -

}

, , . ::, :

demo::i = 100; demo::func2(10);

, , , ::, :

void demo::fun1(int) { / *... * / }

. .

, using:

using demo::i:

.

- , using namespace:

using namespace demo;

using using namespace , :

namespace Department_of_App1ied_Mathematics{

using demo::i;

...

}

, using, , using namespace. , .

, , :

namespace DAM = Department_of_Applied_Mathematics;





:


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


:

:

, .
==> ...

1713 - | 1581 -


© 2015-2024 lektsii.org - -

: 0.012 .