Entrance Exams
Govt. Exams
In row-major order: address = base + (i*m*n + j*n + k) where m=3, n=4. So arr[1][2][3] = base + 1*12 + 2*4 + 3 = base + 23.
String literals are stored in read-only memory. Attempting to modify them causes undefined behavior or segmentation fault at runtime.
C standard defines arr[i] as *(arr + i). Both notations access the same memory location and perform identically.
\n is a single character (newline). 'Hello' = 5 + \n = 1 + 'World' = 5, total = 11 characters (not counting null terminator).
Array names are non-modifiable lvalues. You cannot use ++ on them. However, individual elements can be accessed and modified.
arr + 3 points to the 4th element (0-indexed). Dereferencing with * gives its value, equivalent to arr[3].
Option B shows two valid ways: pointer to string literal or character array. Option A is wrong (single char), C is wrong (no String type in C).
Arrays decay to pointers when passed to functions. Only the address of the first element is passed, not a copy of entire array.
strncat() allows specifying maximum characters to concatenate, preventing buffer overflow. strcat() has no size limit.
sizeof(arr) returns the total size of the array in bytes. For char arr[100], it returns 100 bytes regardless of content.