How to gain Access to member variables of a class using void pointer but Not Object

后端 未结 6 1171
暖寄归人
暖寄归人 2021-01-24 21:29

I am trying to access member variables of a class without using object. please let me know how to go about.

class TestMem
{
    int a;
    int b;
public:
    Tes         


        
6条回答
  •  渐次进展
    2021-01-24 22:09

    Simple answer: Don't do it.

    There just can not be any situation where you can justify accessing like this. There just has to be a different solution.

提交回复
热议问题