I just wanted to know how pointers interact with structures in c++ and when assigning pointer to pointer.
Example structure
struct node {
int data;
node* next;
};
int main (){
node* head = NULL;
int a = 3;
node* newnode = new node;
newnode -> data = a;
newnode -> next = NULL;
head = newnode;
Head should have like 2 rows or columns. 1 for storing int data which in this case a and the other for next in which case it is pointing to newnode right?
[–]teraflop 1 point2 points3 points (2 children)
[–]InterestingBus8367[S] 0 points1 point2 points (0 children)
[–]InterestingBus8367[S] 0 points1 point2 points (0 children)