Quiz


1.  

What is a user -defined data type?

a user-defined data type is a group of primitive data types defined by the programmer.

2.  

How do you determine the size of a structure?

the size of a structure is the sum of the sizes of all the primitive data types within the structure.

3.  

Why would you use a structure?

you use a structure to group together related data.

4.  

Why happens when you declare an instance of a structure?

when you declare an instance of a structure, memory is reserved for all the primitive data types defined within the structure.

5.  

How do you access parts of a 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.

6.  

What is a pointer?

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.

7.  

Why would you use a pointer in a program?

you use a pointer in a program in order to reduce the number of times data is copied within memory.

8.  

What is a pointer to a pointer?

a pointer to a pointer is a variable whose value is an address of another pointer variable.

9.  

Why would you use a pointer to a pointer in a program?

you use a pointer to a pointer in a program in order to arrange data without having to move data in memory.

10.  

What is shown on the screen if you display the content of a pointer variable?

the address is shown on the screen if you display the content of a pointer variable.

Answers

1.  

A user-defined data type is a group of primitive data types defined by the programmer.

2.  

The size of a structure is the sum of the sizes of all the primitive data types within the structure.

3.  

You use a structure to group together related data.

4.  

When you declare an instance of a structure, memory is reserved for all the primitive data types defined within the structure.

5.  

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.

6.  

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.

7.  

You use a pointer in a program in order to reduce the number of times data is copied within memory.

8.  

A pointer to a pointer is a variable whose value is an address of another pointer variable.

9.  

You use a pointer to a pointer in a program in order to arrange data without having to move data in memory.

10.  

The address is shown on the screen if you display the content of a pointer variable.




Data Structures Demystified
Data Structures Demystified (Demystified)
ISBN: 0072253592
EAN: 2147483647
Year: 2006
Pages: 90

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net