Thread: ifstream getline

  1. #1
    Registered User jimboob's Avatar
    Join Date
    Jun 2004

    Question ifstream getline

    Hi all,
    Just wondering if there is a way to overload the getline function so that it can exit on both a '\n' or a '\ ' (space).

    I tried getline(Buffer, 10, '\n' | ' ') along with many other things.


  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Why not just read a line and then parse it like everyone else?
    My best code is written with the delete key.

  3. #3
    if you know were to expect a '\'
    in your file, then you could always
    use a 2nd getline, but if the '\'
    is random then its not a possiblity

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ifstream with getline?
    By DigiAcid in forum C++ Programming
    Replies: 13
    Last Post: 03-08-2009, 08:14 AM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  3. problem with string class, ifstream, and getline
    By deathbob in forum C++ Programming
    Replies: 9
    Last Post: 09-18-2005, 11:20 AM
  4. getline() and ifstream
    By quizkiwi in forum C++ Programming
    Replies: 5
    Last Post: 08-31-2004, 01:44 PM
  5. getline help
    By ProjectsProject in forum C++ Programming
    Replies: 3
    Last Post: 06-14-2004, 11:12 AM