Relationship Between Arrays and Pointers Interview Questions: Model Answers in C
Learn a precise way to explain arrays and pointers in C, then test it against worked address traces, parameter mutation, 2D arrays, and bounds questions.
KnowledgeGate Team
Exam prep & CS education

A candidate says “an array is a pointer” because a and &a[0] often print the same address, then gets stuck on sizeof a, &a + 1, function parameters, or a 2D array. The reliable model separates the declared object, array-to-pointer conversion, resulting type, arithmetic step, and valid bounds. The examples trace five integers from illustrative address 0x1000, mutate an array through a function parameter, and reach a matrix row at 0x200C.
Are arrays and pointers the same in C?
The model answer is: “No. An array is a fixed-size object containing contiguous elements. In most expressions, an array expression is converted to a pointer to its first element. That is why array and pointer syntax can look interchangeable, although their types and operations differ.”
With int a[5];, a is declared as an array of 5 int. It normally converts to an int * pointing at a[0], but the declaration creates no pointer object. In two important non-conversion contexts, sizeof a examines the whole array and &a takes its address.
The rule a[i] == *(a + i) holds when i designates an array element. It describes expression semantics, not the array object's type. The Arrays and Pointers in C guide develops this distinction further. The earlier Call by Value, Address and Reference interview questions post owns C's value and pointer-parameter semantics; array decay, pointer types, and multidimensional row stride are developed here.
Worked address trace: one array, two pointer types and five values
Use int a[5] = {7, 11, 13, 17, 19}; int *p = a;. Only for this illustration, assume sizeof(int) = 4, sizeof(int *) = 8, and &a[0] = 0x1000.
Expression | Type after any conversion | Illustrative value | Result |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
| stored pointer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| whole array |
|
|
| one |
|
|
| five |
Thus sizeof a = 5 x 4 = 20 bytes, while sizeof p = 8 here. Despite equal addresses, int * steps by one int; int (*)[5] by the array. p++ is valid in range. a++ and a = p are invalid because an array is not a modifiable pointer.

Six array-pointer interview questions with compact model answers
Question | Short answer | Follow-up proof |
|---|---|---|
Why does | It means |
|
Does | Yes, as | Addition is commutative; |
Can the array name be reassigned or incremented? | No; a pointer variable can. | An array is not a modifiable pointer. |
Why can | One sees an array, one a pointer. |
|
What differs between | Their types and steps differ. |
|
Can one-past-the-end be used? | Form it for same-array comparison or subtraction, but never dereference it. | It names no element. |
For int b[4] = {2, 4, 6, 8}; int *q = b + 1;, *q is 4, *(q + 2) is 8, and q[-1] is 2. All designate elements of b. Give rule and reason.
Why an array parameter behaves like a pointer
Consider this call:
void bump(int x[4], size_t n) {
if (n > 1) x[1] += 10;
x++;
}
int a[4] = {3, 5, 7, 9};
bump(a, 4);Here int x[4] is adjusted to int *x. The update changes the caller's array to {3, 15, 7, 9}, while x++ changes only the local pointer copy.
Writing [4] here does not transmit length. Inside bump, sizeof x is sizeof(int *), not 4 * sizeof(int), so the caller must pass n or another bound. In this parameter position, void read(int x[], size_t n) and void read(int *x, size_t n) declare the same adjusted type. This equivalence does not apply outside function parameters. Arrays and Strings in C: Decay, sizeof and 2D Addresses provides more traces.
The 2D-array follow-up: why int [2][3] does not become int **
Use int m[2][3] = {{1, 2, 3}, {4, 5, 6}};. For this drawing only, assume sizeof(int) = 4 and &m[0][0] = 0x2000. The expression m normally converts to a pointer to its first row, with type int (*)[3]. One m + 1 step therefore skips 3 x 4 = 12 bytes and reaches 0x200C.
Now compute m[1][2] = *(*(m + 1) + 2). First, m + 1 identifies row 1 at 0x200C. That row expression leads to its first element, and adding 2 reaches m[1][2] at 0x2014. Dereferencing gives 6.
An int ** is wrong here because it describes a pointer to a pointer. It does not carry the fixed three-int row stride of this contiguous matrix. The matching parameter forms are void show(size_t rows, int m[][3]) and void show(size_t rows, int (*m)[3]). Both retain the column count required for row arithmetic.
![Diagram of a 2 by 3 int matrix showing row stride, element addresses, pointer-to-row type, and the m[1][2] calculation.](https://cdn.knowledgegate.ai/blog-assets/blog_asset_1786784452051_rz3nvz.jpg)
Pointer arithmetic, bounds and string traps
Return to the five-element a under the same illustrative assumptions: 4-byte int, 8-byte pointer, and base address 0x1000. The one-past pointer a + 5 may be formed and has the shown address 0x1014, but *(a + 5) has undefined behaviour. a + 5 and &a + 1 can share that numeric address while having different types and arising from different arithmetic.
Subtraction within the array counts elements: &a[4] - &a[1] = 4 - 1 = 3, not 12 bytes. Pointer subtraction or relational ordering across unrelated arrays is not valid portable reasoning.
Now compare char s[] = "CAT"; with const char *t = "CAT";. The object s is a four-element array containing {'C', 'A', 'T', '\0'}, so s[0] = 'B' is valid. The pointer t points at a string literal, and code must not attempt t[0] = 'B'. A string literal is not a modifiable heap or stack buffer.
How interviews test arrays and pointers at different depths
Interviewers can stop at different points, so practise a progression from definition to output trace, parameter mutation, 2D-array type, then a bounds and undefined-behaviour follow-up.
Use this sequence: declaration -> decay context -> resulting type -> step size -> bounds -> value. A closed-book drill:
For
int b[4] = {10, 20, 30, 40}; int *q = &b[3];,q - bis3because subtraction counts elements.sizeof b / sizeof b[0]is4in the declaring scope. It cannot recover the length from a function's adjustedint b[]parameter.With
int (*r)[4] = &b;, the statement(*r)[2] = 99;changesbto{10, 20, 99, 40}.
Use the Arrays and Pointers in C: 10 Solved MCQs as a closed-book check: state each rule before viewing its solution.
Arrays and pointers in C: the short version and next step
Test | Rule | Ask |
|---|---|---|
Object or expression | An array expression usually decays. | Did it decay? |
| Types set steps. | Element or whole array? |
| Array size differs from pointer size. | Operand type? |
Parameter | Adjusts to a pointer. | Bound source? |
2D array or | Fixed row width, not pointer chain. | Row stride? |
Checksum: 13, 20, 0x1004 versus 0x1014, {3, 15, 7, 9}, and 6 at 0x2014. Explain each. Next: C Language course for fundamentals, Interview & Resume Preparation Course for delivery, or All Courses and Exams for the wider route.
Keep learning
Relationship Between Arrays and Pointers in C: Decay, Address Arithmetic and a Worked Memory Trace
See why an array is not a pointer, even when their displayed addresses match. Trace decay, pointer movement, sizeof, function parameters and bounds through one C array.
Relationship Between Arrays and Pointers in C: 10 Solved MCQs
Test the difference between arrays and pointers through 10 solved C questions. Each answer traces the expression, address movement, or declaration step by step.
Arrays and Pointers in C Formula Sheet: Address Rules and Revision Notes
Revise C arrays and pointers through compact identities, exact address traces, operator parsing, decay traps, and a practical retrieval routine.
Arrays and Pointers in C: 7 GATE Mistakes That Cost Marks
Stop treating arrays and pointers as interchangeable. Trace seven common C mistakes through small examples involving types, addresses, bounds and side effects.





