Exercise

1.Reference is like a?

A. Pointer
B. Structure
C. Array
D. None of above

View Answer


2.Which of the following statement is correct?

A. An array of references is acceptable.
B. Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
C. An array of references is not acceptable.
D. Reference is like a structure.

View Answer


3.Identify the correct sentence regarding inequality between reference and pointer.

A. We can not create the array of reference
B. We can create the Array of reference
C. We can use reference to reference
D. None of the above

View Answer


4.The symbol [ ] denotes the

A. Logical operator
B. Subscript operator
C. Relational operator
D. None of the above

View Answer


5.Which of the following functions must use reference.

A. Assignment operator function
B. Destructor
C. Copy constructor
D. Parameterized constructor

View Answer


6.Which of the following statements is correct?
i) We can return a global variable by reference.
ii) We can return a global variable by reference.

A. Only i is correct.
B. Only ii is correct.
C. Both i and ii are correct.
D. Both i and ii are incorrect.

View Answer


7.What does a reference provide?

A. Alternate name for the class
B. Alternate name for the variable
C. Alternate name for the pointer
D. None of the above

View Answer


8. Dereference operator is also called as

A. pointer
B. Reference operator
C. Offset operator
D. Deoffset operator

View Answer


9.Which of the following is FALSE about references in C++

A. Refrencecs can not be null
B. Refrences must be initialized when declared
C. Once a reference is created, it cannot be later made to reference another object; it cannot be reset.
D. References cannot refer to constant value

View Answer


10.A reference is declared using the _____ symbol.

A. &&
B. &
C. ||
D. !

View Answer


11.Which value can we not assign to reference?

A. Integer
B. Floating
C. Unsigned
D. Null

View Answer


12.The terms lvalue and rvalue is referred to the things that appears on

A. The left side of assignments
B. The right side of assignments
C. The end of program
D. Both A and B

View Answer


13.Which of the following statements is correct?
i) Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.
ii) A reference is not a constant pointer.

A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.

View Answer


14.Which of the following statements is correct?
i) Change a reference changes the referent.
ii) We can create an array of references.

A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Both 1 and 2 are incorrect.

View Answer


15.Which of the following statement is correct?

A. A referenced has to be de-referenced to access a value.
B. A referenced does not need to be de-referenced to access a value.
C. A referenced has to be double de-referenced to access a value.
D. Whether a reference should be de-referenced or not depends on the type of the reference.

View Answer



Discussion

* You must be logged in to add comment.