Thread: I/O newline

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

    I/O newline

    i wanna make a program that reads the text (no problemo here)
    but how do you can make the program uses newlines?

    example:
    txt file:
    this is a test
    test

    when i run my program to read it:
    this is a test test
    it must be:
    this is a test
    test

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    How are you reading the file?
    If you are using getline, it will stop at the newline character. So simply display the text you read, then cout << endl;

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    7
    i use istream

  4. #4
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330
    ... istream::getline ()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Buffered/UnBuffered I/O
    By valaris in forum C Programming
    Replies: 1
    Last Post: 08-06-2008, 11:31 PM
  2. asynchronized I/O == multiplexing I/O?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 07-24-2006, 10:06 AM
  3. why page based I/O can improve performance?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 06-12-2006, 07:42 AM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  5. Overlapped I/O and Completion Port :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 10-30-2002, 05:14 PM