Thread: PRINTF problem

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    47

    PRINTF problem

    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?

  2. #2
    Registered User quagsire's Avatar
    Join Date
    Jun 2002
    Posts
    60
    printf("%s\n\r",buffer);

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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems reading entered race times C
    By loopymoo26 in forum C Programming
    Replies: 12
    Last Post: 05-23-2009, 07:38 AM
  2. Help with a C Programing Quiz project
    By dilemma in forum C Programming
    Replies: 12
    Last Post: 05-15-2009, 03:35 PM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. error in program????
    By SpEkTrE in forum C Programming
    Replies: 5
    Last Post: 11-24-2003, 06:16 PM
  5. Drawing tables in C
    By stanoman in forum C Programming
    Replies: 5
    Last Post: 10-09-2003, 10:14 AM