ifstream getline

This is a discussion on ifstream getline within the C++ Programming forums, part of the General Programming Boards category; Hi all, Just wondering if there is a way to overload the getline function so that it can exit on ...

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

    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.

    TIA

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

  3. #3
    Banned
    Join Date
    Aug 2004
    Posts
    128
    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

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