PRINTF problem [Archive] - C Board

PDA

View Full Version : PRINTF problem


Chronom1
07-09-2002, 08:19 PM
Hey. Im writing a chat program that uses threads and continuelly reads from a text file to compare messages and refresh yours. I use the command

printf("%s\n",buffer);
the \n is telling it to go to next line so that when it refreshes again it will print on a new line. But rather than printing at the beginning of line on the next line it prints it where it left off on the line before but on the next line down. any ideas of what is wrong?

quagsire
07-09-2002, 11:11 PM
printf("%s\n\r",buffer);

The \r are for carriage return and the \n for newline