Thread: reading from a certain point in a file

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    17

    reading from a certain point in a file

    first of all thank you for your time but I have come to a point where I need the community's help. I have looked on google and searched the forums but I can still not find the answer I am looking for.

    the question is there is such a syntax as x.readline(blaa). But I need to read from a certain line (lets say line 2). Is there any possible way in which I could read this?.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Read a line and throw it away?

    Or, I suppose, you could seek, if you knew that each line was the same (fixed) length.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    17
    how would I go about throwing away a line? not really used the fstream libary before.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Just read the line and ignore the result.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 07:51 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM