← Quiz: Stack and Queue in C: all 10 questions
Quiz: Stack and Queue in C · Question 6 of 10
Why does a linked-list push take struct node top?
Why does a linked-list push take struct node **top?
- A.Because malloc needs it
- B.To make the list circular
- C.Because it must change the caller's top pointer, and C passes arguments by value
- D.It does not — a single pointer works the same
Answer & explanation
Correct answer: Because it must change the caller's top pointer, and C passes arguments by value
With a plain pointer, the function would update only its own copy.
Can you get the rest right without peeking?
Take the timed Quiz: Stack and Queue in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →