🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Because malloc needs it
  2. B.To make the list circular
  3. C.Because it must change the caller's top pointer, and C passes arguments by value
  4. 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 →