futuredreams 2005年12月10日
一些很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
...全文
547 点赞 收藏 12
写回复
12 条回复

还没有回复,快来抢沙发~

发动态
发帖子
非技术区
创建于2007-09-28

4416

社区成员

5.8w+

社区内容

C/C++ 非技术区
社区公告
暂无公告