LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 630|回复: 4

怎么这个程序不能通过?

[复制链接]
发表于 2003-10-9 21:17:00 | 显示全部楼层 |阅读模式
[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!!!
 楼主| 发表于 2003-10-9 21:30:33 | 显示全部楼层
我懂了。原来源程序名要有.c的。
 楼主| 发表于 2003-10-9 21:57:09 | 显示全部楼层
我懂了。原来源程序名要有.c的。
 楼主| 发表于 2003-10-9 22:22:53 | 显示全部楼层
我懂了。原来源程序名要有.c的。
 楼主| 发表于 2003-10-9 22:47:33 | 显示全部楼层
不好意思,不知道发了这么多。请版主原谅。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表