Which of the following statements is true about pointers and arrays in C?
17 views
- A pointer and an array are the same thing in C.
- An array name is a pointer to the first element of the array. (Correct Answer)
- An array can be passed to a function, but a pointer cannot.
- Pointer arithmetic cannot be performed on arrays.
Explanation
Correct answer: b) An array name is a pointer to the first element of the array.
Explanation: In C, an array name is a pointer to the first element of the array. This means that we can use pointer arithmetic to access other elements in the array. For example, arr[3] is equivalent to *(arr+3).