State whether the following are true or false. If the answer is false, explain why.
1) The address operator & can be applied only to constants and to expressions.
2) A pointer that is declared to be of type void * can be dereferenced.
3) Pointers of different types can’t be assigned to one another without a cast operation.
4) All arguments to function calls in C++ are passed by value.
1) False. The operand of the address operator must be an lvalue; the address operator cannot be applied to constants or to expressions that do not result in references.
2) False. A pointer to void cannot be dereferenced. Such a pointer does not have a type that enables the compiler to determine the number of bytes of memory to dereferenced and the type of the data to which the pointer points.
3) False. Pointers of any type can be assigned to void pointers. Pointers of type void can be assigned to pointers of other types only with an explicit type cast.
4) False. C++ enables pass-by-reference using reference parameters (and pointers, as we discuss in Chapter 7).
You might also like to view...
A security administrator wants to block unauthorized access to a web server using a locally installed software program. Which of the following should the administrator deploy?
A. NIDS B. HIPS C. NIPS D. HIDS
WEP2 uses a different authentication system known as ____.
A. RADIUS B. MS-CHAPS C. LDAP D. Kerberos
In which category is the Twirl filter found?
A. Distort B. Texturize C. Blur D. None of the above
Select the best reason to include height and width attributes on an tag.
a. they are required attributes and must always be included b. to help the browser render the page faster because it reserves the appropriate space for the image c. to help the browser display the image in its own window d. none of the above