Home » Technical Questions » Programming

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

Correct Answer: 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

← Previous Question Next Question→

More Questions from Programming

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion