State which of the following are true and which are false. If a statement is false, explain why.
1) When passing a non-const argument to a const function, the const_cast operator
should be used to cast away the “const-ness” of the function.
2) A mutable data member cannot be modified in a const member function.
3) namespaces are guaranteed to be unique.
4) Like class bodies, namespace bodies also end in semicolons.
5) namespaces cannot have namespaces as members.
1) False. It is legal to pass a non-const argument to a const function. However, when passing a const reference or pointer to a non-const function, the const_cast operator should be used to cast away the “const-ness” of the reference or pointer.
2) False. A mutable data member is always modifiable, even in a const member function.
3) False. Programmers might inadvertently choose the namespace already in use.
4) False. namespace bodies do not end in semicolons.
5) False. namespaces can be nested.
You might also like to view...
The size of an ellipse drawn using the FillEllipse method is specified in ________.
a) points b) pixels c) centimeters d) dialog units e) inches
Which database object filters out specific data based on the criteria you set?
A) Queries B) Forms C) Fields D) Relationships
When you want to locate files meeting two criteria, you use which Boolean operator??
A. ?AND B. ?OR C. ?NOT D. ?" "
What method should be used to pass an array to a function that does not modify the array and only looks at it using array subscript notation?
a) A constant pointer to constant data. b) A constant pointer to nonconstant data. c) A nonconstant pointer to constant data. d) A nonconstant pointer to constant data.