• embed_me
    link
    fedilink
    arrow-up
    5
    ·
    9 days ago

    I only program in C. I was under the assumption that \n also flushes

    • pelya@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      8 days ago

      It depends on whether you are printing to a terminal or to a file (and yes the terminal is also a file), and even then you can control the flushing behaviour using something like unbuffer

    • ulterno
      link
      fedilink
      English
      arrow-up
      2
      ·
      8 days ago

      I remember having to fflush a couple of times.