Introduction

Types of Arrays

  1. Fixed size arrays ⇒ don't allow more items than current capacity
  2. Dynamic size arrays ⇒ automatically resize

Fixed Size Arrays

Note:

  1. stack segment allocation
int arr[100];
int arr[n];
int arr[] = {1,2,3,4,5};
  1. heap segment allocation
int *arr = new int[n];
int arr[] = new int[n];

Dynamic Size Arrays