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

Which category of primitive functions has a function that returns an object’s height?

a. Point of view b. Proximity c. Size d. Spatial relation e. None of these

Computer Science & Information Technology

Which of the following statements is true?

a. The UML models a parameter of an operation by listing the parameter name, followed by a colon and the parameter value between the parentheses after the operation name. b. The UML indicates an operation’s return type by placing a colon and the return value after the parentheses following the operation name. c. UML class diagrams do not specify return types for operations that do not return values. d. Declaring instance variables public is known as data hiding or information hiding.

Computer Science & Information Technology

The name of the active workbook appears in the status bar of the Excel window. _________________________  

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

After the initial boot of a Nano Server image, you can change the IP address settings.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology