返回

C语言面试笔试题解析

发布时间:2023-01-13 22:16:26 252
# html

试题

​​https://www.oh100.com/kaoshi/c/619470.html​​

(6) B

#include 
#include


void sub(int x,int y,int* z){
*z=y-x;
}
int main()
{
int a=0,b=0,c=0;
sub(10,5,&a);
sub(7,a,&b);
sub(a,b,&c);
printf("%d %d %d", a, b, c);
return 0;
}

(7)  题目好像有错,转义字符

(8)指针和整数要用&

#include 
#include


int main()
{
int a=1,b=0,*c;
c = a;

printf("%d", *c);
return 0;
}

结果:出错

#include 
#include


int main()
{
int a=1,b=0,*c;
*c = a;

printf("%d", *c);
return 0;
}

输出:出错

#include 
#include


int main()
{
int a=1,b=0,*c;
c = &a;

printf("%d", *c);
return 0;
}

输出:1

(9)

#include 
#include


int main()
{
int i=5;

printf("%d",i+++++i);
return 0;
}

error: lvalue required as increment operand


特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报
评论区(0)
按点赞数排序
用户头像
精选文章
thumb 中国研究员首次曝光美国国安局顶级后门—“方程式组织”
thumb 俄乌线上战争,网络攻击弥漫着数字硝烟
thumb 从网络安全角度了解俄罗斯入侵乌克兰的相关事件时间线