Introduction to C++
You will need programmer tools for code editing.
Visit Development tools.The First Program
Once you have your code editor ready, you can start writing your first program.
When learning a new programming language, the first thing you do is a simple application that displays the following text: "Hello, World!".
After creating the project, in your environment, a file with the extension .cpp
has probably been automatically added.
Most often it is called main.cpp
(sometimes Source.cpp
or ProjectName.cpp
).
If there is none, create one and name it main.cpp
.
If you don't know how to add a file to your project, see the tools section and find a tutorial for an editor of your choice.
We will save all our code in this file for now.
Application code
Paste the following code and run it:
#include <iostream>
int main()
{
std::cout << "Hello, World!";
}
Hello, World!
You should see an output like the one above.
You will find an explanation of the above code in the next lesson. 🙂