作业帮 > 综合 > 作业

关于C++的英文选择题(下半部分)?跪求大神解答!!!!

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/20 11:42:12
关于C++的英文选择题(下半部分)?跪求大神解答!!!!
8: In the expression n = x + rand() % y;
a. y is the shifting value.
b. x is the scaling value.
c. y is the scaling value.
d. Both (a) and (b).

9: srand:
a. Should be called before each call to rand.
b. Should be used instead of rand to generate truly random numbers.
c. Is unnecessary in C++.
d. Can use the time function’s return value as an optimal seed value.

10: An identifier’s storage class:
a. Determines whether an identifier is known only in the current source file or in any source file with proper declarations.
b. Determines the period during which that identifier exists in memory.
c. Determines where the identifier can be referenced in a program.
d. All of the above.

11: Which of the following is not true of static local variables?
a. They are accessible outside of the function in which they are defined.
b. They retain their values when the function in which they are defined terminates.
c. They are initialized to zero if not explicitly initialized by the programmer.
d. They can be of type int.

12: What happens when two blocks, one nested inside of the other, both declare variables with the same identifier? (Assume that the outer block declares its variable before the opening left-brace of the inner block.)
a. A syntax error occurs.
b. The “outer” variable is hidden while the “inner” variable is in scope.
c. The “outer” variable is irretrievably lost when the “inner” variable is declared.
d. The “inner” declaration is ignored and the “outer” variable has scope even inside the inner block.

13: When an argument is passed-by-value, changes in the called function __________ affect the original variable’s value; when an argument is passed call-by-reference, changes in the called function __________ affect the original variable’s value.
a. Do not, do.
b. Do not, do not.
c. Do, do.
d. Do, do not.

14: If the function int volume( int x = 1, int y = 1, int z = 1 ); is called by the expression volume( 3 ), how many default arguments are used?
a. None.
b. One.
c. Two.
d. Three.

15: Overloaded functions must have:
a. Different parameter lists.
b. Different return types.
c. The same number of parameters.
d. The same number of default arguments.
C D D A B A C A
再问: 帮忙看一下前面这几道!
http://zhidao.baidu.com/question/919539641768540339.html