, :
. . , .
, , .
:
1) , ;
2) .
3)
4) . -
Class Demo{
Const int a;
Int b,c;
public:
Demo():a(0),b(1){c=2;};
};
, . , .
, , .
:
1)
2)
3)
4) const, volatite, static
, ( ). , .. , . , :
1) -
2) ( )
:
1) static
2)
3) delete .
4) .
void my_func(){
Point B1; Point* t1=new Point(10,-3);
Point * t2=new Point(0,16);
delete t1; // , t1;
return; // B1,
}
this. .
, , . .
: __ _::*_(_)
: _ (_::*_)(_)
( ) , . .
|
|
(.*) (->*) .
Struct Demo
{ int count;
int Count() {return count;};
};
Int main()
{
Demo d;
Demo* dp=&d;
int Demo::*ip; // -
int Demo::*fp(c) // -
ip=&Demo::Count; //
fp=Demo::Count; // -//-
this.
, . , - this, , . . , ..
Const Point
Point::greater(const Point&c)const
{if (module()->c.module())
return *this;
return c;}
. . , . - . , , . .