Hi everyone!
I need this: the user can choose the name of the output file, however, if the file can not be open, the program will automatically use cout. I donīt want to do this with if, because there are many regions in the program that use this output file, the code will become dirty if I use if
A sample high-level algorithm would be:
Thanks any help!Code:out_file.open(user_file); if(!out_file){ out_file = cout; } //use out_file at will



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.
. Iīve changed your code hk_mp5kpdw, hope you donīt mind.
my reply was towards the orignal poster of this thread, not you hehe.