今天终于迈出了自己LINUX下写C的第一步,在VI下写的程序,在GCC下面编译链接的,VI的使用比较不方便,目前还不太习惯。
fei@fei-pc:~$ vi test.c
fei@fei-pc:~$ vi test.c
fei@fei-pc:~$ gcc -o test test.c
test.c:9: error: ‘N’ undeclared here (not in a function)
test.c: In function ‘main’:
test.c:42: error: too few arguments to function ‘input’
test.c:43: error: too few arguments to function ‘print’
fei@fei-pc:~$ vi test.c
fei@fei-pc:~$ gcc -o test test.c
test.c: In function ‘printf’:
test.c:29: error: number of arguments doesn’t match prototype
/usr/include/stdio.h:339: error: prototype declaration
fei@fei-pc:~$ vi test.c
fei@fei-pc:~$ gcc -o test test.c
fei@fei-pc:~$ ./test
please input 1 of 5
num: ^[[4~
name: try
score 1.45
score 2.45
score 3.45
please input 2 of 5
num: ^[[1~
name: dfs
score 1.89