Get Started
884

Q: Point out the error, ifany, in the followingb code? typedef struct {      int data;      NODEPTR link; } *NODEPTR;

  • Show Answer
  • Workspace

Answer :
Explanation :

A typedef defines a new name for a type, and in simpler cases like the one shown below you can define a new structure type and a typedef for it at the same time. typedef struct {     char name[20];     int age; } emp; However, in the structure defined in this question, there is an error because a typedef declaration cannot be used until it is defined. In the given code fragment the typedef declaration is not yet defined at he point where the link field is declared.

The Most Comprehensive Exam Preparation Platform

Get the Examsbook Prep App Today