|
Hi...my teacher assigned a project which i completed succesfully however along with the source code she requires the out put but says that we cannot copy and paste from the console.
She gave instructions to place output into a file:
Include the following header file:
#include <fstream.h>
If you want to output into a file called Proj1-Output.dat (in a disk in drive a:), include the following declaration above main()
ofstream outf("a:Proj1-Output.dat", ios::out);
Now to output into the file use "outf" instead of "cout". "outf" is a user-defined identifier and hence can be changed to any name you want.
You must verify that the output generated by your program is correct. You should not edit your output file.
However I wrote...ofstream outf("/forum/CProj1_output.txt", ios::out);
but when i found the text file it was blank...where am i supposed to save the file and how do i open it to print it
|
|
|
|
|
|
|
// |