I/O newline

This is a discussion on I/O newline within the C++ Programming forums, part of the General Programming Boards category; i wanna make a program that reads the text (no problemo here) but how do you can make the program ...

  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, 09:46 AM
  5. Overlapped I/O and Completion Port :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 10-30-2002, 04:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21