一些很bt的C++笔试题目,求答案
请看最后的3套题目,全部是关于指针野指针的,求正确答案:
http://dfsc.cn/mambo/forum/index.php?topic=35.0
例子:
3. Consider the following program:
main()
{
int a[][3] = { 1,2,3 ,4,5,6};
int (*ptr)[3] =a;
printf("%d %d " ,(*ptr)[1], (*ptr)[2] );
++ptr;
printf("%d %d" ,(*ptr)[1], (*ptr)[2] );
}
The output for this program is:
(a) 2 3 5 6
(b) 2 3 4 5
(c) 4 5 0 0
(d) None of the above
12. Object modules generated by assemblers that contain unresolved external references are resolved for two or more object modules by a/an
(A) linker
(B) loader
(C) operating system
(D) debugger
(E) compiler
16. In a multiprogramming system, a set of processes is deadlocked if each process in the set is waiting for an event to occur that can be initiated only by another process in the set. Which of the following is NOT one of the four conditions that are necessary for deadlock to occur?
(A) mutual exclusion
(B) partial assignment of resources
(C) nonpreemption
(D) process suspension
(E) circular wait