Aral Code

Getting Started Lesson 1 of 17

Introduction to C++

What C++ is, how it grew from C, where it's used, what makes it powerful, and the parts of a first C++ program with cout.

C++ was created by Bjarne Stroustrup, starting in 1979, as "C with Classes". It keeps C's speed and control over memory, and adds tools for organizing large programs. Today it's one of the most important languages for performance-critical software.

Your first C++ program

#include <iostream>
using namespace std;

int main() {
    cout << "Mabuhay, Pilipinas!" << endl;
    return 0;
}

Output

Mabuhay, Pilipinas!
  • #include <iostream> brings in input/output streams (cout and cin).
  • using namespace std; lets you write cout instead of std::cout. Everything in the standard library lives in the std namespace.
  • int main() is where the program starts.
  • cout << ... sends text to the screen. << is called the insertion operator.
  • endl ends the line (you can also use "\n").

Where is C++ used?

AreaExamples
GamesUnreal Engine, many console and PC games
Big applicationsChrome, Photoshop, Microsoft Office
Embedded and roboticsArduino, drones, cars, factory machines
Finance and scienceTrading systems, simulations
Competitive programmingThe most popular language in coding contests like ICPC and NOI.PH

What C++ adds to C

  • Classes and objects for object-oriented programming.
  • std::string: text that grows automatically, no '\0' worries.
  • std::vector: arrays that resize themselves.
  • References: a simpler alternative to many pointer uses.
  • The STL (Standard Template Library): ready-made containers and algorithms like sort.
  • Exceptions for error handling.

Compiled and fast

Like C, C++ is compiled directly to machine code, so programs run very fast. The compiler checks types carefully, catching many mistakes before the program runs.

C++ versus other languages

C++JavaPython
SpeedVery fastFastSlower
MemoryYou control itGarbage collectedGarbage collected
Learning curveSteeperMediumGentle
Printcout << "Hi";System.out.println("Hi");print("Hi")

About using namespace std

This course uses using namespace std; to keep examples short, as most textbooks and schools do. In large professional projects, many programmers write std::cout and std::string instead, to avoid name clashes. Both are correct; just know that cout and std::cout are the same thing.

Quick Quiz

Check what you learned. Walang grade ito, practice lang. 🙂

1. Who created C++?
2. Which header provides cout?
3. What does using namespace std; do?
4. Which is the most popular language in competitive programming contests?

By Sir Reyel · Last updated 2026-12-04