sakra 发表于 2020-10-23 06:22:02

不能编译,求问

#include<stdio.h>

#define URL "http://www.fishc.com"
#define NAME "鱼C工作室"
#define BOSS "小甲鱼"
#define YEAR 2010
#define MONTH 5
#define DAY 20

int main()
{
                printf("%s成立于%d年%d月%d日",NAME,YEAR,MONTH,DAY);
                printf("%s是%s创立的\n",NAME,BOSS);
                printf("%s的域名是%s\n",NAME,URL);
               
                return 0;
}

编译的时候出现这个
test.c: In function ‘main’:
test.c:12: error: stray ‘\357’ in program
test.c:12: error: stray ‘\274’ in program
test.c:12: error: stray ‘\214’ in program
test.c:12: error: expected ‘)’ before string constant
test.c:12: error: stray ‘\357’ in program
test.c:12: error: stray ‘\274’ in program
test.c:12: error: stray ‘\214’ in program
test.c:12: error: stray ‘\357’ in program
test.c:12: error: stray ‘\274’ in program
test.c:12: error: stray ‘\214’ in program
test.c:12: error: stray ‘\357’ in program
test.c:12: error: stray ‘\274’ in program
test.c:12: error: stray ‘\214’ in program
求问大佬是哪里出错了

LuLD 发表于 2020-10-23 08:24:18

printf("%s成立于%d年%d月%d日",NAME,YEAR,MONTH,DAY);
这一行代码里的 逗号 是中文下的

应该要用英文下的字符

代码中应该要注意 中英文输入
页: [1]
查看完整版本: 不能编译,求问