noknow.dev
Sign inSign up
Course overview
C++ Fundamentals
0 / 39 lessons0%

Getting Started

  • Hello, World!
  • Variables and Data Types
  • Arithmetic and Operators
  • Working with std::string
  • Type Conversion and Casting

Control Flow

  • if / else if / else
  • switch / case
  • while and do-while Loops
  • for Loops
  • break, continue, and Finding Primes

Functions

  • Writing Functions
  • Pass by Value vs. Pass by Reference
  • Overloading and Default Parameters
  • Recursion

Arrays and Strings

  • C-style Arrays
  • std::vector — Dynamic Arrays
  • std::string Deep Dive
  • 2D Arrays and Matrices

Pointers and Memory

  • Memory Addresses and Pointers
  • Dynamic Memory: new and delete
  • References vs Pointers

Object-Oriented Programming

  • Classes and Objects
  • Constructors and Destructors
  • Inheritance
  • Virtual Functions and Polymorphism
  • Operator Overloading

The Standard Template Library

  • std::vector in Depth
  • std::map and std::unordered_map
  • std::set and Sorted Unique Collections
  • STL Algorithms

Templates and Generic Programming

  • Function Templates
  • Class Templates

Modern C++ (C++11/14/17)

  • auto and Range-based for
  • Lambda Functions
  • Smart Pointers
  • Move Semantics

Error Handling and Exceptions

  • try / catch / throw
  • Custom Exception Classes
  • RAII and Resource Management

C-style Arrays

0m 00s

Fixed-size Collections

int scores[5] = {90, 85, 78, 92, 88};

cout << scores[0];   // 90  (zero-indexed)
cout << scores[4];   // 88
scores[2] = 80;      // modify element

Iterating

int nums[4] = {10, 20, 30, 40};
int total = 0;
for (int i = 0; i < 4; i++) total += nums[i];

Passing arrays to functions

Arrays decay to pointers — always pass the size separately:

int sum(int arr[], int size) {
    int s = 0;
    for (int i = 0; i < size; i++) s += arr[i];
    return s;
}
int data[] = {1,2,3};
cout << sum(data, 3);  // 6

Your Task

Write arrayMax(int arr[], int size) that returns the largest element.

Back
cppCtrl+Enter to run
Output

Click "Run" to execute your code.