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...
When a dynamic DNS record is created, what is the TTL value used for?
A. To determine how many hops away the updating client is B. To specify the time before the next update C. To specify how long the record should remain in the DNS database D. To determine how long it takes for a ping to reach the client and come back
To retrieve a value from a map, you call the __________ member function and pass the __________ that is associated with the desired value.
a. at(), key b. at(), value c. key(), key d. pair(), key e. None of these