|
-
February 25th, 2006, 12:46 PM
#1
More strings and ifstream questions ...
Hey guys.
Not long ago I started this thread with a task
I wanted done.
http://www.codeguru.com/forum/showthread.php?t=376601
I have a fully functional program right now and I'm even "porting" it to VC++ to make use of a GUI.
But before I do this, is there a way to open a file as input and as output?!?!?
For example can I say:
ifstream inW("text.txt");
ofstream outW("text.txt");
without any problems??
I'm asking this because, let's say that I ran my program which opens one file and records changes to another file, like:
ifstream inFile("entrada.txt");
ofstream outFile("salida.txt");
//Process input file and records to output
inFile.close();
outFile.close();
Now, let's say that I want to go back to a specific line in "salida.txt".
Can I open "salida.txt" as input, go to a specific line (let's say line #7), modify this line, and save the output WITHOUT modifying anything else
on the file and just this line?!?!
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|