How to access id using ptr
?
class A
{
int id;
public:
int *ptr;
};
void main()
{
int A::* ptr = &A :: id;
getch();
}
How to access id using ptr
?
class A
{
int id;
public:
int *ptr;
};
void main()
{
int A::* ptr = &A :: id;
getch();
}
Try This
class A {
int id;
public:
int *ptr= &id;
};
You can use the variable pointer to access id.