#include 'stdio.h' main() { int a,b, *p1,*p2,*p; a=1;b=2; p1=&a; p2= &b; if(a <b) { p=p1; p1=p2; p2=p; } printf('%d, %d ',a,b); }

这段代码存在一个编译错误:第11行的大括号没有正确闭合。

修正后的代码:

#include 'stdio.h' main() { int a,b, *p1,*p2,*p; a=1;b=2; p1=&a; p2= &b; if(a <b) { p=p1; p1=p2; p2=p; } printf('%d, %d ',a,b); }

输出结果:

2, 1

C语言代码错误分析:#include

原文地址: https://www.cveoy.top/t/topic/ol56 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录