[amp_mcq option1=”you save many lines of code by not rewriting an identical structure definition in each function that uses it” option2=”you will never change its definition” option3=”it is required in C++” option4=”All of the above” correct=”option1″]
The correct answer is: A. you save many lines of code by not rewriting an identical structure definition in each function that uses it.
A structure type is a user-defined data type that can be used to group together multiple data items of different types. When you define a structure type globally, you can use it in any function in your program without having to re-define it each time. This can save you a lot of time and effort, especially if you are working with a large program.
The other options are incorrect because:
- Option B is not always true. You may need to change the definition of a structure type if you need to add or remove fields from it, or if you need to change the type of one of the fields.
- Option C is not true. You can define a structure type locally in a function, and it will only be available in that function.
- Option D is not true. You only need to define a structure type globally if you want to use it in multiple functions in your program.