Skip to content
Related Articles

Related Articles

C Quiz – 108 | Question 3
  • Difficulty Level : Basic
  • Last Updated : 17 Oct, 2015
GeeksforGeeks - Summer Carnival Banner

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




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

(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

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :