您的位置:学习中国 电脑维护 维护工具 正文
原作者:www 添加时间:2007-12-16 原文发表:2007-12-16 人气:824 来源:www

本文章共15679字,分29页,当前第22页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《C/C++ 笔试、面试题目大汇总(22)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------

37. main 主函数执行完毕后,是否可能会再执行一段代码,给出说明?
答案:可以,可以用_onexit 注册一个函数,它会在main 之后执行int fn1(void), fn2(void), fn3(void), fn4 (void);
void main( void )
{
String str("zhanglin");
_onexit( fn1 );
_onexit( fn2 );
_onexit( fn3 );
_onexit( fn4 );
printf( "This is executed first.\n" );
}
int fn1()
{
printf( "next.\n" );
return 0;
}
int fn2()
{
printf( "executed " );
return 0;
}
int fn3()
{
printf( "is " );
return 0;
}
int fn4()
{
printf( "This " );
return 0;
}
The _onexit function is passed the address of a function (func) to be c
alled when the program terminates normally. Successive calls to _onexit create a register of functions that are executed in LIFO (last-in-first-out) order. The functions passed to _onexit cannot take parameters.


38. 如何判断一段程序是由C 编译程序还是由C++编译程序编译的?
答案:
#ifdef __cplusplus
cout<<"c++";
#else
cout<<"c";
 

本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 下一页>>
本页地址
相关文章

解答一道传说是北大计算机面试的题目
计算机毕业 应聘面试题目大全
微软的招聘智力题(考考你自己)
收藏微软面试智力题 (附答案)
46家中外知名企业面试题目
面试考题大全
常见面试题目解析
IBM面试:以一个杯子即兴发挥
这些“怪题”20分钟考翻学子
用人单位以貌取人还出怪题

相关评论


本文章所属分类:首页 电脑维护 维护工具   维护工具