D
dost
as in a class private section we can access the private data member in
main through the pointers...is their any way to access the member
functions which are written in private section.....
class Myclass{
private:
int a;
void disp()
{
cout<<"hello"
}
};
void main
{
Myclass obj;
int *p=(int *)&obj;
*p=50;//the value of a is chjanged now
}
thank you
kapil kaushik
main through the pointers...is their any way to access the member
functions which are written in private section.....
class Myclass{
private:
int a;
void disp()
{
cout<<"hello"
}
};
void main
{
Myclass obj;
int *p=(int *)&obj;
*p=50;//the value of a is chjanged now
}
thank you
kapil kaushik