Programming - C++ Language
You Are Here :: Home > C++ Language > Pointers - General Questions
7. |
What does the following statement mean? int (*fp)(char*)
|
A. |
pointer to a pointer |
B.
|
pointer to an array of chars |
C.
|
pointer to function taking a char* argument and returns an int
|
D.
|
function taking a char* argument and returning a pointer to int
|
|
Answer: Option C
Explanation:
|
8. |
The operator used for dereferencing or indirection is ____
|
|
Answer: Option A
Explanation:
|
9. |
Choose the right option string* x, y;
|
A. |
x is a pointer to a string, y is a string |
B.
|
y is a pointer to a string, x is a string |
C.
|
both x and y are pointer to string types
|
D.
|
none of the mentioned
|
|
Answer: Option A
Explanation:
|
10. |
Which one of the following is not a possible state for a pointer.
|
A. |
hold the address of the specific object |
B.
|
point one past the end of an object |
C.
|
zero
|
D.
|
point to a type
|
|
Answer: Option D
Explanation:
A pointer can be in only 3 states a,b and c. |
|
11. |
A pointer to the base class can hold address of
|
A. |
only base class object |
B.
|
only derived class object |
C.
|
base class object as well as derived class object
|
D.
|
None of the above
|
|
Answer: Option C
Explanation:
|
12. |
this pointer
|
A. |
implicitly points to an object. |
B.
|
can be explicitly used in a class. |
C.
|
can be used to return an object.
|
D.
|
All of the above.
|
|
Answer: Option D
Explanation:
|
« prev
next »