Which of the following c code is used to create new node? *
ptr = (NODE*)malloc(sizeof(NODE));
ptr = (NODE*)malloc(NODE);
ptr = (NODE*)malloc(sizeof(NODE*));
ptr = (NODE)malloc(sizeof(NODE));
Answers
Answered by
1
Explanation:
ptr = (NODE*)malloc(sizeof(NODE));
Answered by
0
Answer:
The correct answer of this question is ptr = (NODE*)malloc(sizeof(NODE)).
Explanation:
Given - c code is used to create new node.
To Find - Which of the following c code is used to create new node?
ptr = (NODE*)malloc(sizeof(NODE)) is the c code is used to create new node.
A node is a struct that contains at least one data field as well as a reference to another node of the same type. Because it includes a pointer to a variable that refers to another variable of the same type, a node is termed a self-referential object.
#SPJ2
Similar questions