#include <stdio.h>
/* 考虑一下哪个输出该用无参函数哪个输出该用有参函数呢? */
int learing()
{
printf("%s\n","小明在慕课上学习");
return 0;
}
int number(int n)
{
printf("小明在慕课网上学习了%d门课程",n);
return 0;
}
int main()
{
learing();
number(5);
return 0;
}
红框中的位置有中文符号,修改即可
你这个程序中有中文符号,提示如下
hello.c: In function 'learing': hello.c:5:46: error: stray '\357' in program printf("%s\n","小明在慕课上学习"); ^ hello.c:5:47: error: stray '\274' in program printf("%s\n","小明在慕课上学习"); ^ hello.c:5:48: error: stray '\233' in program printf("%s\n","小明在慕课上学习"); ^ hello.c:6:5: error: expected ';' before 'return' return 0; ^~~~~~