Thursday, June 5, 2014

Writting Your First C++ Application (Hello Word !)

Create a new project and write a basic program "Hello World"
Now that you know the tools and the steps involved, it is time to program your first C++ application. If you are on Windows and using Microsoft Visual C++ Express, you can follow these steps:
1. Create a new project via the menu option File -> New -> Project.

2. Choose type Win32 Console Application.

3.  And uncheck the Use Precompiled Header option.

4. Name your project Hello and replace the automatically generated contents in Hello.cpp with the code snippet:

Building and Executing Your First C++ Application
If you’re using Microsoft Visual C++ Express, press Ctrl + F5 to run your program directly via the IDE. This compiles, links, and executes your application. 


You could also do the individual steps: 
1. Right-click the project and select Build to generate the executable.
2. Navigate to the path of the executable using the command-prompt (typically under the Debug directory of the project folder).
3. Run it by typing the name of the executable.

No comments:

Post a Comment