Create Your First C Plus Plus Program
In this guide I'm going to show you how to create your first C++ program which includes the following steps
- Installing an IDE (Integrated Development Environment)
- Creating a new project
- Writing your first bit of code
- Compiling and running your code
So lets get started
Things You Will Need
In order to write your code you will need an IDE. This is where you do all your programming.To get started get either Dev C++ by Bloodshed or Visual C++ Express Edition by Microsoft. Both are free and easy to get started with.
Step 1
Create a new project by going to File -> Project. The options will vary depending on the IDE but choose "empty project" and call it "HelloWorld"Once you have your project opened you need a source file. This is where you type in the code. In Visual C++ you can right click on the source foler and go to Add -> New File the select a C++ file. The processis similar with Dev C++. Call the file main.cpp
Step 2
Now that you have your source file we can finally write some code.Type the following into main.cpp
#include
using namespace std;
int main()
{
cout << "Hello, world!"
return 0;
}
If there are no errors then you should get a dos window that says "Hello, world!". If you get an error and check the code above and make sure you have copied it exactly as it is in cluding the ";".
That was a quick and dirty intro to C++. I have also done a more detailed version of this c++ hello world where I go through each line of code and explain why it's there and what it does. I will also be releasing more programming tutorials soon so go to Game With Me and subscribe to the newsletter or RSS feed.


Yes
No
Flag





Comments
Add a new comment - No HTMLYou must be logged in and verified to post a comment. Please log in or sign up to comment.