What is the advantage of using pointers to structures instead of directly using structures?
- Easier debugging
- Enhanced code readability
- Faster access to data
- Improved memory management
Using pointers to structures allows for improved memory management by reducing memory wastage. When a structure is passed as a function argument, it is copied, leading to extra memory usage. Pointers avoid this issue.
Loading...
Related Quiz
- What is the primary purpose of the malloc function in C?
- In a C++ application, you notice that a function is being called with different types of arguments, but there is only one function definition. What feature of C++ could be allowing this behavior?
- In a program that manipulates text, you need to store multiple strings. What is a potential issue with using character arrays instead of string literals?
- What is a key characteristic of a union in C?
- The ________ keyword in C suggests to the compiler to use a CPU register for the variable to optimize access time.