C++ Tutorial
Learn C++, a fast, powerful language with object-oriented and generic programming, used for games, systems and competitive coding.
C++ was developed by Bjarne Stroustrup at Bell Labs starting in 1979, originally as "C with Classes". It's a superset of C (with minor exceptions) that adds classes, templates, exceptions and the Standard Template Library (STL).
First C++ Program
#include <iostream>
using namespace std;
int main() {
cout << "Hello, C++!" << endl;
return 0;
}
Hello, C++!
C vs C++
| C | C++ |
|---|---|
| Procedural | Procedural + object-oriented + generic |
| No classes, no function overloading | Classes, overloading, templates |
printf/scanf | cout/cin streams |
malloc/free | new/delete |
| No references | References (int &r = x;) |
| No exception handling | try/catch/throw |
Track your progress through the C++ course