OK guys, I Open a file, read it, and close it, but when I reopen it, to read it again, it still sits at the end of file... how to I go back to the top of the file before closing it?
returning to the top of a file
Collapse
X
-
Tags: None
-
never mind, I figured that out, I forgot to tell it to clear(). However, I have another question, and rather than start a new topic, How do you set command prompt size from within C++? -
Really??Originally posted by mohaakilla51I forgot to tell it to clear().
I thought you needed to re-open the file using ios_base::beg.Comment
-
no, it actually went back to the top of the file when I re-opened it, but the eof trigger was still set... I needed to clear the file.
So what about my second question??Comment
-
BTW, in C the fopen method should bring you to the starting position every time you call it. I don't know why you have that kind of weird situation after you close the file stream and exit. Anyway, use the rewind() method is to take you back to the starting position of the file in your file process.Comment
-
OK guys, I figured out that problem, it did actually go back to the start of the file, I just hadn't cleared the eof property, so when I tested, it told me it was at the end of file already.
On a side note: How do you set the width and height of the command prompt from within C++?Comment
-
Start a new thread, please.Originally posted by mohaakilla51On a side note: How do you set the width and height of the command prompt from within C++?Comment
-
Comment