You are developing a contact management system where each contact can have multiple addresses (home, work, etc.). How can you efficiently represent this information using structures?
- By creating a separate database for addresses
- By using an array for each contact
- By using separate variables for each address
- By utilizing a structure to hold multiple addresses within a contact structure
To efficiently represent multiple addresses for each contact, you can use a structure to hold multiple addresses within a contact structure. This approach ensures that each contact can have different types of addresses, such as home and work, making it a practical way to manage contact information.
Loading...
Related Quiz
- How can double pointers be used in dynamic memory allocation in C?
- In C, pointers can be used to pass ________ to a function.
- The fread function in C is used to read data from a file and stores the data in the ________.
- To declare a pointer to an integer in C, you would write ________.
- What would be an appropriate use case for a union in C?