C++ Advanced

Classes & objects, the STL containers, and references.

3 lessons 5 tasks ⚡ Live compiler
Lessons Compiler Quiz Certificate

📚 Lessons

1 Classes & objects

A class bundles data and behaviour. Objects are instances. Access control (public/private) enforces encapsulation.

class Point {
public:
  int x, y;
  int sum() { return x + y; }
};
Point p{3, 4};
// p.sum() == 7

2 STL containers

The Standard Template Library offers vector, map, set and algorithms like sort — reusable and efficient.

#include <vector>
std::vector<int> v{3, 1, 2};
std::sort(v.begin(), v.end()); // 1 2 3

3 References & efficiency

A reference (int&) is an alias — pass large objects by const reference to avoid costly copies. (The runnable example sums even numbers.)

#include <iostream>
using namespace std;

int main() {
    int sum = 0;
    for (int i = 2; i <= 20; i += 2) sum += i;
    cout << "sum of evens = " << sum << endl;
    return 0;
}

⚡ C++ Compiler

Code runs on a learning-oriented simulated runtime that supports common constructs (output, variables, arithmetic, conditionals and loops).

CPP

            

📝 Tasks

5 tasks across 2 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.

🎓 Certificate of Completion

🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.