c**********e 发帖数: 2007 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: careerchange (Stupid), 信区: JobHunting
标 题: C++ Q 103-105
发信站: BBS 未名空间站 (Fri Oct 28 23:15:10 2011, 美东)
C++ Q 103: stream manipulators
Multiple choices
Which options are true of stream manipulators?
a. To use manipulators, you need only to include iostream.h as a header in
your C++ program
b. To use manipulators, you need only to include iomanip.h in your program
c. Stream manipulators are special functions which can be included in an I/O
expression
d. endl is a stream manipulator
Answer: b, c, d
C++ Q 104: object reference
Multiple choices
Which of the following statements are correct?
a. When passing an object to a function, the object must be initialized
prior to being passed to the function argument
b. When returning objects from a function, the objects in the calling
function
must be compatible to the returned objects
c. When returning an object to a function, the object must be initialized
prior
to being passed to the function argument
d. When passing objects from a function, the objects in the calling function
must be compatible to the objects returned by the called function
Answer: a and b
C++ Q 105: function templates
Multiple choices
Identify the true statements about function templates
a. All template definitions must be preceded by the keyword 'class'
b. The code in a template changes every time the function template is
instantiated
c. Every formal parameter in the template definition must appear at least
once
in the function's parameter list
d. Formal parameter names must be unique in the parameter list of a template
function
Answer: c and d |
|