Advertisement

any way to do this?

Started by February 02, 2002 10:30 AM
3 comments, last by StoNeD_TrOLL 22 years, 7 months ago
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?
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.
Advertisement
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~
--------------------------~The Feature Creep of the Family~
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.
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

This topic is closed to new replies.

Advertisement