Thread: Filestream Out + move cursor back one place

  1. #1
    Registered User
    Join Date
    Mar 2002

    Filestream Out + move cursor back one place

    Hey thank-you for looking, my 1st post, and I'm really stumped.

    I want to know if it is possible to move the filestream cursor back one space inside the file that I'm saving to. I have to save an array inside a for loop. This gives me a problem because I have to END each line of text in the file before starting the next line.

    e.g. (* represents where i would like the cursor to be after write)

    sex* - want cursor to finish here

    This code below outputs this result

    * - at present cursor ends here

    for(int counter = 0; counter < 5; counter ++)
    ArrayDataOutfile << customer[Int_counter].Char_Name << endl;
    ArrayDataOutfile << customer[Int_counter].Char_age << endl;
    ArrayDataOutfile << customer[Int_counter].Char_sex<< endl;

    I am using MS visual c++ 6 and notepad files as output and input.

    Hope you can understand this problem, I'm really stuck and have been searching for ages for a fix.

    Thank-you very much in advance




  2. #2
    As i understand file steams the position of the end of file is determined by a pointert's value. off the top of my head i cannot rember the pointer name, but maybe this info will help.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle algorithm
    By PJYelton in forum A Brief History of
    Replies: 11
    Last Post: 08-05-2003, 10:28 AM
  2. Pathfinding AI? (Not the A* Algorithim)
    By harryP in forum C++ Programming
    Replies: 22
    Last Post: 08-01-2003, 02:32 PM
  3. Is there a bug in this part of my algorithm for connect 4?
    By Nutshell in forum Game Programming
    Replies: 8
    Last Post: 04-28-2002, 01:58 AM
  4. Berlin: Searching for a place to stay
    By fabs in forum A Brief History of
    Replies: 0
    Last Post: 01-14-2002, 02:18 AM
  5. Where is a good place to start?!
    By bobthefish3 in forum Game Programming
    Replies: 1
    Last Post: 10-09-2001, 11:28 AM