codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Plz help-Need to print output file  need2no at 22:20 on Wednesday, February 27, 2008
 

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








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  onclick multiple functions
•  source code for Voice Command Edotor
•  Plz help-Need to print output file
•  Web Development Project
•  Using shift while looping through multidimensional array using foreach
•  Doubt regarding JSP
•  Well formed DHTML in Blogger template
•  Re: Rewrite this program with good style
•  Re: Non dereferencable iterator C++


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008