Suppose we write a function for a class which is not supposed to change any data members in the class. When we test the class, we get a runtime error. After tracking down the source of the runtime error, we realize that this function mistakenly changed the value of a data member. To make things easier, we should have:

A. passed parameters into the function using const reference
B. declared all the data members as constant (using const at the front of their declarations)
C. used const at the end of the function prototype
D. used a Peterson Language Modifier

C

Computer Science & Information Technology

You might also like to view...

To determine a monthly interest rate, you must divide the annual interest rate by:

A) twelve. B) six. C) four. D) two.

Computer Science & Information Technology

Marking a location with a(n) path does not change your document's appearance in any way; it merely creates a destination within your document.

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

Computer Science & Information Technology