Two kinds of arrays need special attention: arrays of characters, which C uses for text, and arrays with more than one index, used for tables and matrices. This page explains both.
Strings
These two declarations create the same 8-element array:
'\0' and '0' are different characters: '\0' has code 0 and ends a string, while '0' is the digit zero with code 48 (in ASCII).
Multidimensional arrays
A multidimensional array has one pair of square brackets for each index:
Declaration of a multidimensional array
data_type array_name[size1][size2] ... [sizeN];
A two-dimensional array int a[3][5]; has 3 rows and 5 columns. Think of it as an array of 3 rows, where each row is itself an array of 5 int:
Elements of int a[3][5]
col 0 col 1 col 2 col 3 col 4row 0 a[0][0] a[0][1] a[0][2] a[0][3] a[0][4]row 1 a[1][0] a[1][1] a[1][2] a[1][3] a[1][4]row 2 a[2][0] a[2][1] a[2][2] a[2][3] a[2][4]
Its memory is
bytes=size1×size2×size of one element,
and for n dimensions you multiply all n sizes.
Key takeaways
A string is a char array terminated by '\0'; a string literal gets the '\0' automatically.
sizeof includes the '\0', strlen does not.
'\0' (value 0) is not '0' (value 48).
A 2-D array is an array of rows; memory = product of dimensions × element size.
Arrays may have any number of dimensions.
Practice questions
Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 6 · short answer
Explain how the string "MCA" is stored in memory and write two equivalent declarations for it.
Show worked answer
It is stored as 4 consecutive bytes: 'M', 'C', 'A' and the null character '\0' (value 0) that marks the end. Declarations: char s[] = "MCA"; (the compiler adds '\0') and char s[] = {'M', 'C', 'A', '\0'}; (the terminator written by hand). Both give sizeof s == 4 and strlen(s) == 3.
MCA Online notes are made for reading on screen. Open https://mcastudy.online/mcs-208/arrays-pointers-and-structures/strings-and-multidimensional-arrays/ to read this page.