Programming - C++ Language
You Are Here :: Home > C++ Language > Pointers - General Questions
1. |
What is pointer?
|
A. |
The variable that stores the reference to another variable |
B.
|
The variable that stores reference of garbage variable |
C.
|
The variable that stores the memory address of another variable
|
D.
|
A & C Both
|
|
Answer: Option D
Explanation:
|
2. |
A _____________ pointer can point to ____________ object.
|
A. |
derived class, base class |
B.
|
void, derived class |
C.
|
void, NULL
|
D.
|
base class, derived class
|
|
Answer: Option D
Explanation:
|
3. |
When the ___________ is present in front of a variable name, it represents the address of that variable.
|
A. |
asterisk ( * ) |
B.
|
conditional operator |
C.
|
ampersand ( & )
|
D.
|
semicolon ( ; )
|
|
Answer: Option C
Explanation:
|
4. |
A pointer variable may be initialized with
|
A. |
any non-zero integer value |
B.
|
any address in the computer's memory |
C.
|
the address of an existing variable
|
D.
|
a and c only
|
|
Answer: Option B
Explanation:
|
5. |
A pointer variable is designed to store ________.
|
A. |
any legal C++ value |
B.
|
only floating-point values |
C.
|
a memory address
|
D.
|
a float value
|
|
Answer: Option C
Explanation:
|
6. |
We should use the delete operator for objects that were ________.
|
A. |
never used |
B.
|
not correctly initialized |
C.
|
created with the new operator
|
D.
|
dereferenced inappropriately
|
|
Answer: Option C
Explanation:
|
next »