problem in file handling

hi dears
i am working with file handling.
i have used fstream object and it read and write method.
there is a problem e.g

syntex:

fstream file;
file.open("data.txt",ios::binary|ios::out|ios::in)
file.read(parameter list)
file.write(parameter list)


i saved 28 records in the file and closed the program.again i run and save the data at the location of 14th record .Now when i see the file all records from 15th to 28th are removed.can any body help me in this regard.

Comments

  • : hi dears
    : i am working with file handling.
    : i have used fstream object and it read and write method.
    : there is a problem e.g
    :
    : syntex:
    :
    : fstream file;
    : file.open("data.txt",ios::binary|ios::out|ios::in)
    : file.read(parameter list)
    : file.write(parameter list)
    :
    :
    : i saved 28 records in the file and closed the program.again i run and save the data at the location of 14th record .Now when i see the file all records from 15th to 28th are removed.can any body help me in this regard.
    :
    >> try string concatenate, or buffer it inside the program.. edit it ans wrie it to file in one huge chunk
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion