|
What is a user-defined data type? | ||
|
How do you determine the size of a structure? | ||
|
Why would you use a structure? | ||
|
Why happens when you declare an instance of a structure? | ||
|
How do you access parts of a structure? | ||
|
What is a pointer? | ||
|
Why would you use a pointer in a program? | ||
|
What is a pointer to a pointer? | ||
|
Why would you use a pointer to a pointer in a program? | ||
|
What is shown on the screen if you display the content of a pointer variable? |
Answers
|
A user-defined data type is a group of primitive data types defined by the programmer. |
|
|
The size of a structure is the sum of the sizes of all the primitive data types within the structure. |
|
|
You use a structure to group together related data. |
|
|
When you declare an instance of a structure, memory is reserved for all the primitive data types defined within the structure. |
|
|
You access parts of a structure by referring to the name of the instance of the structure followed by the dot operator, which is then followed by a primitive data type that is defined within the structure. |
|
|
A pointer is a variable and can be used as an element of a structure and as an attribute of a class in some programming languages such as C++, but not Java. However, the contents of a pointer is a memory address of another location of memory, which is usually the memory address of another variable, element of a structure, or attribute of a class. |
|
|
You use a pointer in a program in order to reduce the number of times data is copied within memory. |
|
|
A pointer to a pointer is a variable whose value is an address of another pointer variable. |
|
|
You use a pointer to a pointer in a program in order to arrange data without having to move data in memory. |
|
|
The address is shown on the screen if you display the content of a pointer variable. |