Manipulation of Files:
I am writing a large program (by my standards but certainly not by most) for school. Anyway, in both of my classes (that is the abstract data type, not school) I am manipulating files. Is there anyway that I can use a variable to connect the filestream to the directory file. I have tried using a string variable in declarations similar to the following:
inFstream.open(filename) //filename is a string
I get compile errors because it wants a constant value. Is there a workaround. I am hoping it is like dynamic arrays and there is a pretty simple answer.
Also, still on the topic of files. How can I goto a specific part of a file and manipulate it? The end of a file?
I learn best from examples but I'm definatatly a newbie at c++ so if you could tone down examples to something human it would be appreciated.
Thanks for any help you can provide:
if you are asking to open a file then this is how i do it..
cout<<"enter file name : ";
>>How can I goto a specific part of a file and manipulate it? The end of a file?
use eof command to detect the end-of- file
or the seekg comman
fin.seekg(30); --> goes to the byte# 30 in the file.