N
Neo
I was written this code; in VS2k5
class Program
{
private: int a;
private: int b;
private: char c;
public: Program( ) : a(10), b(20), c('Y'){ }
};
int _tmain(int argc, _TCHAR* argv[])
{
A obj;
int temp = *((int *)&obj + 1);
char ch = *((char *)&obj + 8);
cout<< temp<<endl<<ch<<endl;
_gettch( );
return 0;
}
in Object Orient World we learn Data Encapsulation or Data Hiding for data
security.
In this code, what is the meaning of Data Encapsulation or Data Hiding for
data security?
Regards,
-neo
class Program
{
private: int a;
private: int b;
private: char c;
public: Program( ) : a(10), b(20), c('Y'){ }
};
int _tmain(int argc, _TCHAR* argv[])
{
A obj;
int temp = *((int *)&obj + 1);
char ch = *((char *)&obj + 8);
cout<< temp<<endl<<ch<<endl;
_gettch( );
return 0;
}
in Object Orient World we learn Data Encapsulation or Data Hiding for data
security.
In this code, what is the meaning of Data Encapsulation or Data Hiding for
data security?
Regards,
-neo