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 / ashwin kumar
Shahzad is correct
next node must be like a 1st node means it must have two
fields one for two store data and another field for
storing address of the next node.
in 2nd field where we have point to the next node we must
store address of the next node , so we are using pointer ,
as we are pointing to a next node of type structure so we
must use
struct NODE *next
plz info me if any mistake in my answer
molugu.ashwin@gmail.com
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is malloc() function?
Explain data types & how many data types supported by c?
What is the use of bit field?
Why isnt there a numbered, multi-level break statement to break out
What does nil mean in c?
State two uses of pointers in C?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Can you return null in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What language is c written?
What is wrong in this statement? scanf(ā%dā,whatnumber);
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What is difference between array and structure in c?
What are the advantages of external class?
Where define directive used?