2023-11-25

Last login: Tue Dec 19 23:59:17 2023 from 192.168.23.1

[root@localhost ~]# ls

anaconda-ks.cfg  democ01.h  democ03.c  Downloads        temp

a.out            democ01.o  democ04.c  Music            Templates

a.txt            democ01pro  democo2.h  original-ks.cfg  Videos

biaoc            democ02.c  Desktop    Pictures

democ01.c        democ02.h  Documents  Public

[root@localhost ~]# vi democ05.c

[root@localhost ~]# g++ democ05.c

democ05.c: In function ‘int main()’:

democ05.c:5:12: error: ‘a’ was not declared in this scope

  val1=val1+a;

            ^

democ05.c:6:12: error: ‘prinf’ was not declared in this scope

  prinf("\n");

            ^

[root@localhost ~]# vi democ05.c

[root@localhost ~]# g++ democ05.c

democ05.c: In function ‘int main()’:

democ05.c:5:12: error: ‘a’ was not declared in this scope

  val1=val1+a;

            ^

[root@localhost ~]# vi democ05.c

[root@localhost ~]# g++ democ05.c

democ05.c: In function ‘int main()’:

democ05.c:5:12: error: ‘a’ was not declared in this scope

  val1=val1+a;

            ^

[root@localhost ~]# vi democ05.c

[root@localhost ~]# g++ democ05.c

[root@localhost ~]# ls

anaconda-ks.cfg  democ01.h  democ03.c  Documents        Public

a.out            democ01.o  democ04.c  Downloads        temp

a.txt            democ01pro  democ05.c  Music            Templates

biaoc            democ02.c  democo2.h  original-ks.cfg  Videos

democ01.c        democ02.h  Desktop    Pictures

[root@localhost ~]# ./a.out

1

2[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]# vi democ05.c

[root@localhost ~]# g++ democ05.c

[root@localhost ~]# ./a.out

1

2

[root@localhost ~]#

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容