Back to Courses
C++ Systems & OOP MasterclassHigh Performance
0 / 16 done
Part 1: C++ Basics & Standard I/OBeginner
Part 2: References, Pointers & FunctionsCore Mechanisms
Part 3: Object-Oriented Programming (OOP)OOP Mastery
Part 4: Standard Template Library (STL)Intermediate
Part 5: Advanced Modern C++ & Systems InternalsAdvanced
C++ Systems & OOP Masterclass Track Progress
0 / 16 Lessons (0%)
C++ Systems & OOP Masterclass/Beginner/C++ Introduction & First Program

C++ Introduction & First Program

Key Takeaway:C++ is an extension of C that adds object-oriented features, used for high-performance games, browsers, and engines.

What Is It & Why Use It?

C++ was developed by Bjarne Stroustrup in 1979 as an enhancement to the C language. It gives programmers high control over system memory while providing modern features like classes and objects. It powers Unreal Engine, Google Chrome, and operating systems.

Example Code

#include <iostream>
using namespace std;

int main() {
    cout << "Hello, World! Welcome to C++." << endl;
    return 0;
}
Language: cpp

Code Line-by-Line Breakdown

#include <iostream>

Header library that allows working with input and output objects like cout.

using namespace std;

Allows using names from the standard library without prefixing std:: every time.

int main() {

Entry point of every C++ program.

cout << "Hello, World!" << endl;

cout (see-out) prints to the screen. << is the stream insertion operator. endl creates a new line.

return 0;

Terminates the main function successfully.

Remember These Rules

C++ uses cout instead of C's printf().
You can chain multiple outputs using <<.
endl flushes the output buffer and moves to a new line.
Quick Test

Which object is used to output text in C++?