Cisc 192 Practice questions
1. A pointer is a variable which contains
a. signed float data
b. signed integer data
c. unsigned float data
d. unsigned integer data
e. signed character data
2. T/F. Data inside a class may be hidden from access
by functions outside the class body.
3. Assuming that spread[] is a one-dimensional
array of type int, which of the following
refers to the value of the third element in the array?
a. *(spread+2) b. *(spread+4)
c. spread+4 d. spread+2
4. T/F. A reference variable may be made to point to several
different objects at different times during the run of the
program.
5. T/F. One of the reasons for using classes
is that code may be more easily re-used
instead of re-written.
6. T/F. Polymorphism consistes of having several
methods or functions with the same name
and different argument lists.
7. Which option stores a 0 in int variable ch,
assuming the address of ch has been assigned to
the pointer fingerch?
a. *fingerch = 0 ;
b. int *fingerch = 0 ;
c. *finger = 0 ;
d. &ch = 0 ;
e. *ch = 0 ;
8. T/F. Code for member functions in a class
can be written outside the class' braces with only
their prototypes inside the class declaration.
9. T/F. A union allows several different types of
variable to share the same memory.
10. T/F. It is possible to successfully write a
function yet not know how many parameters will be
passed to it by the calling routine.
更新1:
我們老師都教我們自己看