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 ~]#