![]() |
Can't ouput charcter until newline in C - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: C, C++, & Obj-C (https://sinister.ly/Forum-C-C-Obj-C) +--- Thread: Can't ouput charcter until newline in C (/Thread-Can-t-ouput-charcter-until-newline-in-C) |
Can't ouput charcter until newline in C - Blink - 04-24-2017 So... I was bored and working on my text editor project, when I found out I can't output characters read from non-canonical mode input right away, they will only output after a newline is made. EX: Code: #define CTRL(key) ((key) & 0x1f) Neither printf or putchar will output anything until the enter key is hit. However, printf("%c\n", x) works fine. Anybody wanna help me with this? RE: Can't ouput charcter until newline in C - Blink - 04-24-2017 Fixed by adding Code: setvbuf(stdout, 0, _IONBF, 0); Closing thread. |