Why would you use a pointer to an array instead of a regular array in a function?
- Pointers allow you to modify the original array in a function.
- Pointers allow you to pass arrays to functions without making a copy.
- Pointers are more memory-efficient than regular arrays.
- Pointers provide a way to dynamically allocate memory for arrays.
Using a pointer to an array in a function allows you to pass the array by reference, avoiding the need to make a copy of the array. This is more memory-efficient and allows you to modify the original array within the function.
Loading...
Related Quiz
- The strlen function returns the length of a string, excluding the ________.
- The ________ directive can be used in C to include a file only once in a program.
- Why might a programmer choose to use an array of structures in a C program?
- In C, a double pointer is a pointer that points to another ________.
- In C++, what is function overloading?