Arrays in C
Fixed-size sequences of elements of one type, stored contiguously.
Beginner
int samples[8] = {0};
size_t n = sizeof samples / sizeof samples[0]; /* 8 */
Indexing is not bounds-checked: samples[8] is undefined behaviour.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.