C++ Tutorial
C++ is a powerful programming language built on top of C. It adds classes and objects, a rich standard library and many modern features, while staying very fast.
C++ is used to build games and game engines, web browsers, banking and trading systems, desktop software and code for robots and devices.
Why Learn C++?
- It is one of the fastest languages, so it is used where speed matters
- It teaches you both low-level ideas (memory) and high-level ideas (classes)
- It is popular in competitive programming and university courses
- Once you know C++, learning Java, C# or Rust is much easier
What You Will Learn
- How to compile and run a C++ program
- Output with cout, input with cin, variables and data types
- Operators, strings, if...else, switch and loops
- Arrays and vectors
- Functions, references, classes and objects
A First Example
Example
#include <iostream>
using namespace std;
int main() {
cout << "Hello from C++!" << endl;
return 0;
}Hello from C++!
The first chapter explains every line of this program.
Check Yourself
Exercise
Which object prints text to the screen in C++?
What to Learn After C++
If you have not learned C yet, it helps you understand what C++ does under the hood. For building business apps, look at C# or Java, which share much of the same syntax.
Want to learn programming with a teacher? The Workownix programming course starts with Python, and the same ideas (variables, loops, functions and classes) carry over to C++. Join online or at our institute in Orangi Town, Karachi.
