Question: Given the following declarations, which statement would allocate memory for the first item in the list? struct Node { int item; Node* link; }; typedef

Given the following declarations, which statement would allocate memory for the first item in the list?

struct Node

{

int item;

Node* link;

};

typedef Node* NodePtr;

NodePtr head;

a) head = new int;

b) head = new Node;

c) head -> link=NULL;

d) head = new NodePtr

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!