Array
Fixed-size collection of elements.
Syntax
type name[size] = {e1, e2, ...};Description
Arrays have a fixed size. Elements are accessed by index starting from 0. C does NOT do bounds checking.
Example
Loading editor…
Expected output
10 30
When to use?
Fixed number of values.
Common mistakes
- ⚠️ Exceeding array bounds (numbers[5]) is undefined behavior; C does not warn you.