|
From: Carlos d. M. <cg...@wo...> - 2002-11-02 17:31:24
|
And for those cases you can use redirection, which means the output to st=
din
is sent to a file you specify, this is for console files. I proved it wit=
h
gprof, which is a part of the compiler's distribution, I haven't ever do =
it
whit my programs, but being this what it is said to be, it shall work.
For that you open the command.exe, or cmd.exe, and type
program yakyakyak > fileyouwantoutput
Abhijit Shylanath escribi=F3:
> > Maybe they're just asking how to handle files in C/C++... If
> > this is the case I sugest you to look for it in any book. Most of the=
m
> > has a part dedicated to this subject.
>
> Zodiaq was being sarcastic... he tends to do that sometimes :).
>
> Anyway, J B, look up file I/O in any book. In C++, we use the ifstream =
and
> ofstream classes to manage this. A small example:
>
> #include <fstream>
>
> int main()
> {
> using std::ofstream;
>
> ofstream of;
>
> of.open("temp.txt");
> if(!of)
> {
> // Error
> }
>
> of << "Blah, blah.\n";
> of.close();
>
> return 0;
> }
>
> ___________________________________________________________
>
> Abhijit Shylanath
>
> E-mail: mu...@gm... || ibr...@bi...
> Web-site: http://mudeth.tripod.com/
>
> -------------------------------------------------------
> This sf.net email is sponsored by: See the NEW Palm
> Tungsten T handheld. Power & Color in a compact size!
> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|