[root@localhost c]# cat switch_case main() { unsigned short x; char c; scanf("%d,$c",&x,&c); switch (c) { case 'D': printf("%dD\n",x); break; case 'O': printf("%oO\n",x); break; case 'X': printf("$xX\n",x); break; default : printf("input error\n !"); } }
[root@localhost c]# gcc --version gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [root@localhost c]# gcc switch_case /usr/bin/ld:switch_case: file format not recognized; treating as linker script /usr/bin/ld:switch_case:1: parse error collect2: ld returned 1 exit status [root@localhost c]#
help me!! thanks i!!! 我懂了。原来源程序名要有.c的。 |