Post by SYTRIX on Aug 1, 2007 21:54:58 GMT -5
In this workshop we shall be learning the programming language of C++,
C++ is a powerful programming language used in many of the advance software we use today. It is also the industry standard for making games on some of the biggest platforms
such as the Playstation 2 and 3, to PC games, and more. During this work shop I will take you step by step from the very basic to the advance side of C++ programming. So, let's get going with our
first program. The world famous HELLO WORLD program.
So, because we are using a programming language, we will need an IDE software package. There are hundreds of them out there, but I recommend this one
Now that you a have an IDE, we can get moving on creating our first program!
1.First off, setup a new project in your IDE.
2. Save it somewhere you will be able to find it when you want to.
Now you are ready to start! First off, I will write out the whole source code, and then I will break it down and explain each line.
This is the source code of a C++ "Hello World" program. It is not very much, but it is a good place to start. Now I will break it down and explain each line.
Line 1- #include <iostream> This line is the most important line in the program, it allows you to write text on the screen.
Line 2- int main(){ } This is the body of the code. All of the code goes between this. You can have a code outside this, but we will talk about that
later.
Line 3 - std::cin.get(); What this line does is hold the application open. If you don't have this line open, it will open and close within a second.
Line 4- return 0; This line tells the IDE that it indicates no problems with the program .
Screen Shot of the Hello World Program
There you have it! Your first C++ program! If you have any
questions please feel free to ask me, SYTRIX.
C++ is a powerful programming language used in many of the advance software we use today. It is also the industry standard for making games on some of the biggest platforms
such as the Playstation 2 and 3, to PC games, and more. During this work shop I will take you step by step from the very basic to the advance side of C++ programming. So, let's get going with our
first program. The world famous HELLO WORLD program.
So, because we are using a programming language, we will need an IDE software package. There are hundreds of them out there, but I recommend this one
Now that you a have an IDE, we can get moving on creating our first program!
1.First off, setup a new project in your IDE.
2. Save it somewhere you will be able to find it when you want to.
Now you are ready to start! First off, I will write out the whole source code, and then I will break it down and explain each line.
#include <iostream>
int main()
{
std::cout << " Hello World ";
std::cin.get();
return 0;
}
This is the source code of a C++ "Hello World" program. It is not very much, but it is a good place to start. Now I will break it down and explain each line.
Line 1- #include <iostream> This line is the most important line in the program, it allows you to write text on the screen.
Line 2- int main(){ } This is the body of the code. All of the code goes between this. You can have a code outside this, but we will talk about that
later.
Line 3 - std::cin.get(); What this line does is hold the application open. If you don't have this line open, it will open and close within a second.
Line 4- return 0; This line tells the IDE that it indicates no problems with the program .
Screen Shot of the Hello World Program
There you have it! Your first C++ program! If you have any
questions please feel free to ask me, SYTRIX.