← C++ tutorial

C++

Introduction to C++

C++ compiles down to machine code and gives you fine control over memory and performance, it's used for games, operating systems, and other performance-critical software where every millisecond and every byte genuinely matters.

Example: a minimal C++ program

#include <iostream>
using namespace std;

int main() {
    cout << "Hello, world!" << endl;
    return 0;
}
Hello, world!

#include <iostream> pulls in the input/output library so cout (console output) is available. << "sends" a value to cout to be printed, and return 0; tells the operating system the program finished successfully, a nonzero return would signal an error occurred, a convention this language shares with C and most command-line tools.

Example
#include <iostream>
using namespace std;

int main() {
    cout << "Hello, world!" << endl;
    return 0;
}
Output
Hello, world!
Ready to go further?

These free tutorials are a preview of what a Code Secure Academy cohort covers, project work and all.

Explore our tracks
Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account