I have a class 'node' which has two members data and *next. When I am accessing data using pointer then it is working fine whereas when i am accessing it using double pointer , it is throwing an error . Can anyone explain me why this is happening?
class node{
public:
int data;
node *next;
};
push(&a,8);
void push(node **p , int x){
*p->data = 11;
}
Why this p->data showing error: request for member ‘data’ in ‘ p’, which is of pointer type ‘node*’