A function can return a value of type T in one of several different ways. Which of these is correct? If correct, give a short declaration of a function that returns its value by these mechanism. Comment on the const methods of function return value. Comment on when there is danger involved in returning a reference of any kind from a function. Finally, which one of these returns an l-value and which an r-value?

a) By value
b) By lazy evaluation.
c) By reference
d) By const value
e) By const reference

a) T f() x
b) Not a mechanism known in C++
c) T& f()
d) const T f()
e)const T& f()

Computer Science & Information Technology

You might also like to view...

After inserting a line into a form or report, you can modify the color, thickness and line type

Indicate whether the statement is true or false

Computer Science & Information Technology

In a @return tag statement the description __________.

a. cannot be longer than one line b. describes the return value c. must be longer than one line d. describes the parameter values

Computer Science & Information Technology