943,503 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 7012
  • C++ RSS
Mar 23rd, 2004
1

exe application

Expand Post »
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;

}
Similar Threads
Reputation Points: 14
Solved Threads: 0
Newbie Poster
popo_prince is offline Offline
12 posts
since Mar 2004
Mar 23rd, 2004
1

Re: exe application

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.
Reputation Points: 12
Solved Threads: 2
Newbie Poster
Steu is offline Offline
11 posts
since Mar 2004
Mar 23rd, 2004
1

Re: exe application

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.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 23rd, 2004
0

Re: exe application

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)
Reputation Points: 12
Solved Threads: 2
Newbie Poster
Steu is offline Offline
11 posts
since Mar 2004
Mar 23rd, 2004
0

Re: exe application

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...
Reputation Points: 14
Solved Threads: 0
Newbie Poster
popo_prince is offline Offline
12 posts
since Mar 2004
Mar 23rd, 2004
0

Re: exe application

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..
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 24th, 2004
0

Re: exe application

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.)
Reputation Points: 12
Solved Threads: 2
Newbie Poster
Steu is offline Offline
11 posts
since Mar 2004
Mar 24th, 2004
0

Re: exe application

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.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 25th, 2004
0

Re: exe application

Quote originally posted by infamous ...
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.
Reputation Points: 14
Solved Threads: 0
Newbie Poster
popo_prince is offline Offline
12 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: For the newbees (like myself)
Next Thread in C++ Forum Timeline: I need help on my 'address book' assignment!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC