Topic 1: Introduction to C++
Topic 2: Variables & Data Types
Topic 1: Introduction to C++
What is C++?
• C++ is a general-purpose programming language created by Bjarne Stroustrup in 1979 (released
1985).
• It is an extension of the C language, adding Object-Oriented Programming (OOP) features.
• It is a compiled, statically-typed, and mid-level language (has features of both low-level and high-
level languages).
Key Features
• Fast and powerful — used in system software, game engines, and competitive programming.
• Supports Object-Oriented Programming: Class, Object, Inheritance, Polymorphism, Encapsulation.
• Rich Standard Template Library (STL) for data structures and algorithms.
• Platform-independent code (can run on different OS after compiling).
Basic Structure of a C++ Program
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}
Explanation:
• #include <iostream> — header file needed for input/output.
• using namespace std; — lets us use cout, cin directly without std::
• int main() — the function where program execution starts.
• cout << — used to print output on the screen.
• return 0; — tells the OS the program ended successfully.
Compilation Process