笔试题循环

时间:2018-12-31 12:00:00 资料大全 我要投稿

笔试题(循环)

三、简答题(25分)
1、头文件中的. ifndef/define/endif 干什么用?
2、#include %26lt;filename.h%26gt; 和
#include "filename.h" 有什么区别?
3、const 有什么用途?(请至少说明两种)
4、在C++ 程序中调用被 C编译器编译后的函数,
为什么要加 extern "C"声明?
5、请简述以下两个for循环的优缺点
// 第一个for (i=0; i%26lt;N; i++)
{if (condition)
DoSomething();
else
DoOtherthing();}
优点:缺点:
// 第二个if (condition)
{for (i=0; i%26lt;N; i++)
DoSomething();}
else{
for (i=0; i%26lt;N; i++) DoOtherthing();}
优点:缺点:
四、有关内存的思考题(20分)
void GetMemory(char *p)
{
p = (char *)malloc(100);
}
void Test(void)
{
char *str = NULL;GetMemory(str);
strcpy(str, "hello world");
printf(str);
}请问运行Test函数会有什么样的结果?答:
char *GetMemory(void)
{
char p[] = "hello world";
return p;
}
void Test(void)
{
char *str = NULL;
str = GetMemory();
printf(str);
}

【笔试题(循环)】相关文章:

1.360笔试题目

2.360笔试题目

3.笔美国国家仪器试题目

4.广本09年笔试题目

5.搜狐产品笔归分享笔试题目

6.绿盟科技全国统一笔试题

7.绿盟科技校招全国统一笔试题

8.笔经B 南方基金海笔