, . , . : , . , , .
, , , , . UNIT- : , UNIT- .
C++
1. ++
C++ C :
* - ;
* ;
* ;
* ;
* ;
* ;
* ;
* ;
* ;
* .
C++ C. C++ , , new delete, bool, , , , , , , ( , , -, , ), , , ::, , . C++ , C.
C++ (//), C BCPL.
C++ C, , const inline, for C++ (//). C , C++, vararg -.
[] C++ C
, C C++, C++ C . C , C++. C, C , C.
. , C++ main() , C . , C++ ; , , .
|
|
, , , , . , ѻ, C, C++ C++. - , C (, 'a') int, C++ char, .
2. ,
++
++ . :
void foo (int& x)
{
x = 17;
}
int main ()
{
int z = 5;
foo (z); // z=17
}
, , :
void foo (const int& x);
.
int const *foo
const int. (, - ), , , .
3. ++. .
C++ , , .
C++
C++ :
class MyClass: public ParentClass // ParentClass -,
{
public:
//
MyClass(); //
~MyClass(); //
protected:
//
private:
// ;
};
, :
MyClass myinstance;
:
myinstance.classmember
, , , , , , .
4. public private?
public private . , private, . . public. . public private, .