评论(7)

#include <stdio.h>
#define NAME "GIGATHINK,INC. "
#define ADDRESS "101 Megabuck Plaza"
#define PLACE "Megapolis,CA 94904"
#define WIDTH 40
void starbar(void);
int main(void)
{
starbar();
printf("%sn",NAME);
printf("%sn",ADDRESS);
printf("%sn",PLACE);
starbar(); /* 使用函数 */
return 0;
}
void starbar(void) /* 定义函数 */
{
int count;
for(count = 1; ount <= WIDTH; count++)
putchar('*');
putchar('n');
}
5 IntelliSense: incomplete type is not allowed d:CworkspacetesttestTest.c 7 6 test
7 IntelliSense: incomplete type is not allowed d:CworkspacetesttestTest.c 19 6 test
6 IntelliSense: expected a ';' d:CworkspacetesttestTest.c 10 1 test
8 IntelliSense: expected a ';' d:CworkspacetesttestTest.c 20 2 test
Error 1 error C2182: 'starbar(void)' : illegal use of type 'void' d:cworkspacetesttesttest.c 7 1 test
Error 3 error C2182: 'starbar(void)' : illegal use of type 'void' d:cworkspacetesttesttest.c 20 1 test
Error 4 error C2054: expected '(' to follow 'starbar(void)' d:cworkspacetesttesttest.c 20 1 test
Error 2 error C2054: expected '(' to follow 'main(void)' d:cworkspacetesttesttest.c 10 1 test
我改成英文分号,还是报这些错误啊

引用来自“cuiliu”的评论
#include <stdio.h>
#define NAME "GIGATHINK,INC. "
#define ADDRESS "101 Megabuck Plaza"
#define PLACE "Megapolis,CA 94904"
#define WIDTH 40
void starbar(void);
int main(void)
{
starbar();
printf("%sn",NAME);
printf("%sn",ADDRESS);
printf("%sn",PLACE);
starbar(); /* 使用函数 */
return 0;
}
void starbar(void) /* 定义函数 */
{
int count;
for(count = 1; ount <= WIDTH; count++)
putchar('*');
putchar('n');
}
5 IntelliSense: incomplete type is not allowed d:CworkspacetesttestTest.c 7 6 test
7 IntelliSense: incomplete type is not allowed d:CworkspacetesttestTest.c 19 6 test
6 IntelliSense: expected a ';' d:CworkspacetesttestTest.c 10 1 test
8 IntelliSense: expected a ';' d:CworkspacetesttestTest.c 20 2 test
Error 1 error C2182: 'starbar(void)' : illegal use of type 'void' d:cworkspacetesttesttest.c 7 1 test
Error 3 error C2182: 'starbar(void)' : illegal use of type 'void' d:cworkspacetesttesttest.c 20 1 test
Error 4 error C2054: expected '(' to follow 'starbar(void)' d:cworkspacetesttesttest.c 20 1 test
Error 2 error C2054: expected '(' to follow 'main(void)' d:cworkspacetesttesttest.c 10 1 test
我改成英文分号,还是报这些错误啊
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。