TATA ELXSI Interview Question

They keep on asking me about the pointers topic for an example - Dynamically allocate memory for an array or structure using malloc() and free().

Interview Answer

Anonymous

Jun 23, 2025

In C, arrays and pointers are closely related. An array name essentially acts as a pointer to the first element of the array. This means you can use pointer notation (like *array + i) to access array elements, and you can also assign the array name to a pointer variable, allowing for pointer arithmetic to navigate the array.