- 1、本文档共21页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
c语言高级面试题
整个测试遵循以下的约定:
??????? 假定在所有的程序中必须的头文件都已经被正确包含。
考虑如下的数据类型:
??????? char 为1个字节
??????? int 为4个字节
??????? long int 为4个字节
??????? float 为4个字节
??????? double 为个8字节
??????? long double 为 8个字节
??????? 指针为4个字节
?
?
1. Consider the following program:
#includesetjmp.h
static jmp_buf buf;
?
main()
{
volatile int b;
b =3;
?
if(setjmp(buf)!=0)
{
printf(%d , b);
exit(0);
}
b=5;
longjmp(buf , 1);
}
The output for this program is: (a) 3(b) 5(c) 0(d) None of the above
2. Consider the following program:
main()
{
struct node
{
int a;
int b;
int c;
};
struct node s= { 3, 5,6 };
struct node *pt = s;
printf(%d , *(int*)pt);
}
The output for this program is: (a) 3(b) 5(c) 6(d) 7
3. Consider the following code segment:
int foo ( int x , int n)
{
int val;
val =1;
if (n0)
{
if (n%2 == 1) val = val *x;
val = val * foo(x*x , n/2);
}
return val;
}
What function of x and n is compute by this code segment?
(a) x^n(b) x*n(c) n^x(d) None of the above
4. Consider the following program:
main()
{
int a[5] = ;
int *ptr = (int*)(a+1);
?
printf(%d %d , *(a+1), *(ptr-1) );
?
}
The output for this program is: (a) 2 2(b) 2 1(c) 2 5(d) None of the above
5. Consider the following program:
void foo(int [][3] );
?
main()
{
int a [3][3]= { { 1,2,3} , { 4,5,6},};
foo(a);
printf(%d , a[2][1]);
}
?
void foo( int b[][3])
{
++ b;
b[1][1] =9;
}
The output for this program is: (a) 8(b) 9(c) 7(d) None of the above
6. Consider the following program:
main()
{
int a, b,c, d;
a=3;
b=5;
c=a,b;
d=(a,b);
?
printf(c=%d ,c);
printf(d=%d ,d);
?
}
The output for this program is: (a) c=3 d=3(b) c=5 d=3(c) c=3 d=5(d) c=5 d=5
7. 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
您可能关注的文档
- Climate Change and Sustainable Development, Case of China.ppt
- Climate Change and Hydrologic Models A Review of Existing Gaps and Recent Research Developments.pdf
- Clinical Evaluation Report for delivery set.doc
- CloudSim源代码学习之虚拟机分配策略.doc
- Cluster Transformation Coefficients for Structure and Dynamics Calculations in nParticle S.pdf
- CloudStack安装常见问题解决.docx
- Clustering Markov States into Equivalence Classes using SVD and Heuristic Search Algorithms.pdf
- CMA 论述 真题.doc
- CMMI中英文术语对照表.docx
- Clustering Overhead and Convergence Time Analysis of the Mobilitybased MultiHop Clusterin.pdf
最近下载
- 苏教版小学五年级上册数学全册教学课件.pptx VIP
- 预应力混凝土用钢材(钢丝、钢棒和钢绞线).doc VIP
- 六年级 句子练习.doc VIP
- DB11-T 1071-2025 北京市排水管渠工程施工质量检验标准.docx VIP
- 热负荷延续时间表.xls VIP
- 山东省烟台市中英文学校2023-2024学年高一下学期期末检测数学试题.docx VIP
- 2025年一级建造师《机电实务》三色速记手册.pdf VIP
- J B∕T 4091-2014 煤矿防爆特殊型蓄电池式电机车基本技术条件.pdf VIP
- 《学记》导读课件.ppt VIP
- 苏教版六年级上册数学全册教学课件 (2).pptx VIP
文档评论(0)