Which of the Following will define a type NODE that is a
node in a Linked list?
A)struct node {NODE*next;int x;};type def struct node NODE;
B)typedef struct NODE {struct NODE *next;int x;};
C)typedef struct NODE {NODE *next;int x;};
D)typedef struct {NODE *next;int x;}NODE;

Answer Posted / shahzad

B)
coz ..linked list node contain two parts ..
one is address to next node
other is data part in single list....
writting keyword struct before NODE is must..

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can insert comments in a c program?

636


What is the correct code to have following output in c using nested for loop?

617


What are the types of data files?

735


What are the different types of data structures in c?

610


Is c call by value?

613






Explain the Difference between the New and Malloc keyword.

691


What is time complexity c?

575


How is a null pointer different from a dangling pointer?

563


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1533


Are bit fields portable?

681


Why do we use int main?

618


What is operator precedence?

649


Differentiate call by value and call by reference?

573


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

737


What is the return type of sizeof?

601