![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2005
Posts: 3
Rep Power: 0
![]() |
C++ Compile
I am new to C++ and I like to study this. I purchased the last version of C++ (2005) and I downloaded Microsoft C++ visual. When I write the program examples as per C++ and I try to compile and look at the effect I don't get any thing.
Please show me the basic steps to compile and look effect of the excercise. should I use dos or C++ visual to compile. Help.. Thank you, Gebreil |
|
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Visual C++ has a built in compile and execute function. I would just use those. What happens when you compile and run the code? Does the Dos window pop up and close real fast, or is there some other problem?
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#3 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 291
Rep Power: 4
![]() |
If you are new at C++ I should recommend you to use Dev-C++ (http://www.bloodshed.net/devcpp.html) instead of the much more complex Visual C++.
To create an application in Visual C++, you first have to create a C++ project. -> File -> New project In the Visual C++ Projects folder, you should pick "Win32 Project" Pick a name and a folder where to save your project and click "OK". Now there will pop up an "Application wizard" window, where you should click on "Application settings". Under "Additional options" select "Empty project". Also select "Console application", and click Finish. Now you have created a C++ project. Now click the Project menu -> Add new item, and select C++-file. This one will now be added to your project. Now cut'n'paste this code below and hit the "Play" button next to the "Debug"-text. ------------------------------ #include <iostream> int main() { std::cout << "It works\n"; system("pause"); return 0; } ------------------------------ The system("pause") call makes the console window opened until you press any key. I recommend you to add this line to the program you are trying to compile. Have a nice day /Klarre |
|
|
|
|
|
#4 |
|
Newbie
Join Date: May 2005
Posts: 3
Rep Power: 0
![]() |
thank you and where I can locate the execute function in Visual C++
|
|
|
|
|
|
#5 |
|
Programmer
Join Date: May 2005
Location: England
Posts: 61
Rep Power: 4
![]() |
Press F7, I believe. Or alt+F7 if you want to run it in non-debug mode.
__________________
http://www.nuticulus.net/hackmysig/sig.PNG Give my site a chance, you know you want to ;-) Google will solve 99% of your problems. Including those with your sex life. Caution, may <strike>contain</strike> be nuts. |
|
|
|
|
|
#6 |
|
Newbie
Join Date: May 2005
Posts: 3
Rep Power: 0
![]() |
how to run a compiled program that done via MS Visual C++. what command should I enter at .the MS-DOS window or there is another way
|
|
|
|
|
|
#7 |
|
Game engine designer
Join Date: May 2005
Location: Sweden
Posts: 291
Rep Power: 4
![]() |
What is the problem? Double click the .exe file as you usually do with your other programs.
* If you take a look in the project folder you created when setting up the project, there will be a Debug-folder. In there you will find your .exe file. * Another way is to dir to your project folder via a console window and type the name of the .exe file, in the Debug folder. * The most simple approach is to click Debug-menu -> Start, in Visual C++. Or press F5. Did I got your question? /Klarre |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|