Yes, if your output is to a terminal then you flush the buffer on every newline. (Or maybe you don't even buffer at all.) If it is to something else (a disk file or a pipe or a socket or a device) then you only flush the buffer when it fills or when you exit.