Arrays

Introduction to Arrays

An array is a linear data structure that stores elements in a contiguous memory location. Each element can be accessed using its index (starting from 0).

Key Properties

Example in C++


#include <iostream>
using namespace std;

int main() {
  int arr[5] = {10, 20, 30, 40, 50};
  cout << "First element: " << arr[0];
  return 0;
}
    

Learning resource

Readings ARRAYS
Videos ARRAYS