file pointers

This is a discussion on file pointers within the C++ Programming forums, part of the General Programming Boards category; Is there any way to read in a line of a file without having the file pointer move on to ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    1

    file pointers

    Is there any way to read in a line of a file without having the file pointer move on to the next line of the file?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,659
    int saved = ftell(fileptr); // save
    fgets(buff, 256, fileptr); // read
    fseek(fileptr, saved, SEEK_SET); // restore



    ITSA
    Socket Library!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 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

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