how would you make a simple exe application for something like this in vis c++. so that you could send it self contained and a person double clicks it and it runs. please show the code and where you would enter it.
thanks

#include <iostream>

using std::cout;
using std::cin;

int main()

{
int a, b, sum;

cout << "enter first number\n";
cin >> a;
cout << "enter second number\n";
cin >> b;

sum = a + b;
cout << "sum is " << sum << std::endl;

return 0;

}

To do this, create a new project (workspace if using vc++ 6) add a new code file, paste your code in there, compile (I believe F7 in vc++ 6, or ctrl-shift-B in vs.net), the exe will be in your project folder, send that to anyone with windows, and it will be able to run, you aren't using anything that needs to be installed.

visual studio usually ships 'neutered', meaning you can't build standalone apps to distribute. depending on what version u have, this is may or may not be true. usually the expensive, ie. Professional Version, lets u build standalone apps. this is done by going to Build->Configurations and selecting Release mode instead of debug mode.

Debug mode is standalone, the exe just contains debugging information, that allows you to step through the code when you set a breakpoint inside the IDE. Even Academic versions allow you to create standalone apps. The license agreement though says that you can't sell any app created by that version of the IDE (I know I got the academic version, and I can send you a C++ OpenGL program compiled in Debug mode that will run standalone)

i thought i had the "neutered" version as well. i have enterprise edition and used to have pro i think and could do it easy enough in visual basicwhich has the option to make an exportable exe option. but here in vis c++ i can't seem to do it. file>new>win 32 con app>empty project and such with no luck in make that exe. i haave check the project files and only have .cpp dsp dsw opt and html doc. no exe...

look in teh folder called Debug inside ur project..
Steu << my bad i think u r correct. i havent used vc++ in ages, but i thought there was some restrictions tho..

Yeah exactly what infamous said it will be in you Debug folder.

@infamous:It may have been that way in previous versions of visual studio, i'm not sure never had it before, and now I get vs.net free from school through the msdnaa. This is the clearest source i could find on the license restrictions http://www.ben.edu/programs/business/msdnaa/

Basically it says I can only use my copy of visual studio .net 2003 for instructional and non-commercial use. (i.e. can't use it to make stuff to sell, would have to buy at least the professional version for that.)

hmm yea i have always used vs6, i'm going to pursue this further and find out just what i was thinkin of and get back2u.

hmm yea i have always used vs6, i'm going to pursue this further and find out just what i was thinkin of and get back2u.

infamous, you were right . build and run, when you close it, it will be in the debug folder as an exe application.
thanks.

This article has been dead for over six months. Start a new discussion instead.