Thread: Skipping the rest of the line while doing file input

  1. #1
    Shadow12345
    Guest

    Skipping the rest of the line while doing file input

    I have a simple program that inputs data...I need a function that goes to the next line of code. So far i have tried ignore() and seekg() but I can't get it to correctly read the data from the text file from the next line.

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    a "line" is kind of a fake concept. it just means carriage return / linefeed (or just carriage return). there are of course ways that this has been done already for you (getline comes to mind) but you could just read each char until you get to the carriage return / line feed and then you'll know its the end of the line.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Shadow12345
    Guest
    well I used seeg('\n') and then ignore two spaces to get to the next line, and, it is working (I checked with real data)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help again with scrolling without wrapping
    By Dukefrukem in forum C Programming
    Replies: 8
    Last Post: 09-21-2007, 12:48 PM
  2. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Skipping to a new line in an input file.
    By earth_angel in forum C Programming
    Replies: 15
    Last Post: 06-14-2005, 01:25 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM