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("C:Proj1-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
• mkdirs
• Re: Web Development Project
• ** Site Hacked ** javascript inserted...
• Losing background/text color when converting HTML to PDF
• hidden div block when displayed, displays at an offset of 200px only in IE 6..
• help - sketch
• Re: Perl Script - File Handling.
• Open a file from website
• Re: to open 5 terminals from one and also execute different commands on each terminal


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