My program uses various printf()
statements. Is it possible to determine at any point of the program if the stdout
cursor is at the start of a new line?
Background: The program uses a custom error routine and I would like to show any error messages on the next blank line. Since the program does not track if the last printf()
ended with \n
, the error routine currently starts each message by printing \n
. This results in two successive \n
(a blank line) if the last printf()
also ended with \n
.