Learn C Programming

Lesson 6 of 9 ¡ Files

Module 13 ¡ Files

The Interview Angle: Buffering, Flushing and the Output That Vanished

ProReading

Kenji's stock program crashes somewhere in the middle. To find where, he puts one line above the line he suspects: printf("before the crash\n");. The Playground shows the badge Runtime error and an empty output box.

Pro lesson

This one goes deeper

It is included with this track and with Learn Pro. Every question on the Skill Test can be answered from the free lessons, so this is depth and never a gate on the certificate.

What is inside The Interview Angle: Buffering, Flushing and the Output That Vanished

  1. Kenji's line ran, and never arrived
  2. Three buffering modes, and who gets which
  3. Why the Playground waits for 4,096 bytes
  4. fflush sends the buffer now
  5. setvbuf chooses the mode
  6. stderr is separate, and never fully buffered
  7. How a program ends decides what survives
  8. The questions interviewers ask