![]() |
how can i access i private data member in main
can you give me the syntax. thanks
|
Re: how can i access i private data member in main
As far as I know you cannot access the private data??
|
Re: how can i access i private data member in main
Three ways, two legal one not. 1. Call the accessor function; 2. Make main a friend of the class and access the member directly. 3. Work out the address of the member and access its memory directly.
Code:
class PrivTestCls |
Re: how can i access i private data member in main
Oh! really
|
| All times are GMT +5.5. The time now is 05:43. |