-
December 3rd, 2002, 12:03 PM
#1
How to give back hand to screen in C ?
Hello everybody,
I have a little problem..
A program I'm modifying has the following behavior :
If an option is given, it will write information messages to the screen, but if an other option is given, it will write information messages to a File named LogFile.txt ...
Now, what's done in the code is this :
freopen("LogFile.txt", "a+", stdout);
To close stdout and assign LogFile.txt to the standard output.
After everything is done, I need to give back the hand to the screen to write a message about the success of the program, based on some text in an other file.
Everything I saw about the freopen function didn't talk about giving back the hand to the screen..
I use
freopen("NUL", "a+", stdout);
to close the stream stdout assigned to LogFile ( it is shared by a lot of programs called from the main one) , but I can't write anything on the screen from then on.
Does anybody know how I can write back to the screen without leaving the program ?
Thanks
Sylvain
Last edited by sylvain_nurun; December 3rd, 2002 at 02:02 PM.
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
|