Thread: just another text input question...

  1. #1
    Registered User
    Join Date
    Mar 2003

    just another text input question...

    ...probably a stupid one...

    ...I am trying to read in many lines of text and so far I can get the program to read in one line and that is it...using ifstream for file input...I am trying to tell it to read all lines until the end of the file...or some string that separates the files...then I wish to save what it has read into a there anything else apart from getline??...

    ...I realise this might be something very simple but we all have to start somewhere right??...

    ...I had tried to save each line....and append them together to then save all in a I totally off??...

    ...thank you so very much...

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Here's a snippet for you
    vector<string> v;
    string str;
    while (getline(cin, str))
    Post some code when you have troubles.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Mar 2003
    40 know what?...I was not putting the getline in a while loop...thank you that solved that problem... the coolest...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 14
    Last Post: 01-18-2008, 04:14 PM
  2. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  3. Structure and Linked List User Input Question
    By kevndale79 in forum C Programming
    Replies: 16
    Last Post: 10-05-2006, 11:09 AM
  4. LaTeX Question: Displaying Text and Images
    By Reisswolf in forum Tech Board
    Replies: 0
    Last Post: 06-30-2006, 08:01 AM
  5. Help on restricting input to a numbers only (or text only)
    By BongoBob in forum C++ Programming
    Replies: 6
    Last Post: 05-14-2006, 08:32 PM