C Quiz – 108 | Question 3

Anyone of the following can be used to declare a node for a singly linked list and “NODEPTR nodePtr;” can be used to declare pointer to a node using any of the following

filter_none

edit
close

play_arrow

link
brightness_4
code

/* First declaration */
typedef struct node
{
 int data;
 struct node *nextPtr;
}* NODEPTR;
  
/* Second declaration */
struct node
{
 int data;
 struct node * nextPtr;
};
typedef struct node * NODEPTR;

chevron_right


(A) TRUE
(B) FALSE


Answer: (A)

Explanation: Yes. Both are equivalent. Either of the above declarations can be used for “NODEPTR nodePtr;”. In fact, first one is the compact form of second one.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.