Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

StoNeD_TrOLL

any way to do this?

This topic is 5983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, i have a small program made that i wanna make into a file and i want to put onto my desk top.When i open the file i wanna see the programs output and beable to use it then be able to send it through email as an attachment. Any body know how i can do this?

Share this post


Link to post
Share on other sites
Advertisement
Hmmmm....I am going to assume you dont know what you are doing. Did you already compile the program? If not, I suggest you do so. After you do, go to the directory that you compiled in, find the executable and simply copy and past it onto your desktop. Now what do you mean by "use its output"? what does your program do? You could write the contents to a text file and then use it, unless you mean something entirely different.

Share this post


Link to post
Share on other sites
Sounds to me like you want to have your program create some kind of text file...?

#include <fstream.h>
...
ofstream File; // Your output file object
// Open the file, using trunc (write it from scratch).
// use "app" to append more data to the end of the file, if you
// prefer...
File.open("C:\output.txt",ios::trunc|ios::binary,filebuf::sh_read||filebuf::sh_write);
// To put (almost) any kind of data into the file,
// just use the << operator.
// note: \r\n is carrige return/linefeed. (a new line)
File << "Beginning of File.\r\n"
int i = 10;
File << "My variable i is set to: " << i << "\r\n";
char * aString = "text";
File << "My string variable says ''" << aString << "''\r\n";
File << "All done now. Goodbye.\r\n";
File.close();
This will give you a textfile called "output.txt" in your root dir, that you can read with notpad and which says:

Beginning of File.
My variable i is set to : 10
My string variable says ''text''
All done now. Goodbye.

---email--- Tok ----surf----
~The Feature Creep of the Family~

Share this post


Link to post
Share on other sites
I assume you know how to put files on your desktop.

Line to the MAPI librarys to be able to mail your programs output.

You will have to have either use your email account, or find a SMTP server that allows anonymous access.

Share this post


Link to post
Share on other sites
quote:
Original post by Sheep
Hmmmm....I am going to assume you dont know what you are doing. Did you already compile the program? If not, I suggest you do so. After you do, go to the directory that you compiled in, find the executable and simply copy and past it onto your desktop. Now what do you mean by "use its output"? what does your program do? You could write the contents to a text file and then use it, unless you mean something entirely different.


It complies fine,wats a directory?
and what are MAPI libraies?



Edited by - StoNeD_TrOLL on February 2, 2002 11:48:54 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!