i want to print "CLIENT>" on stdout in c, without new line. printf("CLIENT>"); does not print enything. how do i solve this?
int main (){ printf("CLIENT>"); }
Try fflush(stdout); after your printf.
fflush(stdout);
printf
You can also investigate setvbuf if you find yourself calling fflush frequently and want to avoid having to call it altogether. Be aware that if you are writing lots of output to standard output then there will probably be a performance penalty to using setvbuf.
setvbuf
fflush
2.1m questions
2.1m answers
60 comments
57.0k users