Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

References

Cpp Programming Quiz 31 – Which of the following statement is correct?

Question: 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.

Answer: Option C

Cpp Programming Quiz 31 – Which of the following statement is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 32 – Which of the following statements is correct?

Question: Which of the following statements is correct?
  1. Pointer to a reference and reference to a pointer both are valid.
  2. When we use reference, we are actually referring to a referent.

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

Answer: Option C

Cpp Programming Quiz 32 – Which of the following statements is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 33 – Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct?

Question: Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct?
  1. The information being returned is a large enough object that returning a reference is more efficient than returning a copy.
  2. The type of the function must be a R-value.

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

Answer: Option C

 

Cpp Programming Quiz 33 – Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 34 – Which of the following statements is correct?

Question: Which of the following statements is correct?
  1. Once the variable and the reference are linked they are tied together.
  2. Once the reference of a variable is declared another reference of that variable is not allowed.

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

Answer: Option A

Cpp Programming Quiz 34 – Which of the following statements is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 37 – Which of the following statement is correct?

Question: 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.

Answer: Option B

Cpp Programming Quiz 37 – Which of the following statement is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 38 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. A reference is declared using * operator.
[B]. Once a reference variable has been defined to refer to a particular variable it can refer to any other variable.[C]. A reference must always be initialized within classes.
[D]. A variable can have multiple references.

Answer: Option D

Cpp Programming Quiz 38 – Which of the following statement is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 39 – Which of the following statement is correct?

Question: Which of the following statement is correct?
[A]. Once a reference variable has been defined to refer to a particular variable it can refer
to any other variable.
[B]. A reference is indicated by using && operator.[C]. Once a reference variable has been defined to refer to a particular variable it cannot refer to any other variable.
[D]. A reference can be declared beforehand and initialized later.

Answer: Option C

 

Cpp Programming Quiz 39 – Which of the following statement is correct? Read More »

Cpp Programming, References

Cpp Programming Quiz 40 – Which of the following statement is correct about the references?

Question: Which of the following statement is correct about the references?
[A]. A reference must always be initialized within functions.
[B]. A reference must always be initialized outside all functions.[C]. A reference must always be initialized.
[D]. Both A and C.

Answer: Option C

Cpp Programming Quiz 40 – Which of the following statement is correct about the references? Read More »

Cpp Programming, References