Visual Studio

cuiliu 发布于 2015/06/15 12:25
阅读 554
收藏 0


加载中
0
L5_Railgun
L5_Railgun

引用来自“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("%s\n",NAME);
printf("%s\n",ADDRESS);
printf("%s\n",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:\Cworkspace\test\test\Test.c 7 6 test
7 IntelliSense: incomplete type is not allowed d:\Cworkspace\test\test\Test.c 19 6 test
6 IntelliSense: expected a ';' d:\Cworkspace\test\test\Test.c 10 1 test
8 IntelliSense: expected a ';' d:\Cworkspace\test\test\Test.c 20 2 test
Error 1 error C2182: 'starbar(void)' : illegal use of type 'void' d:\cworkspace\test\test\test.c 7 1 test
Error 3 error C2182: 'starbar(void)' : illegal use of type 'void' d:\cworkspace\test\test\test.c 20 1 test
Error 4 error C2054: expected '(' to follow 'starbar(void)' d:\cworkspace\test\test\test.c 20 1 test
Error 2 error C2054: expected '(' to follow 'main(void)' d:\cworkspace\test\test\test.c 10 1 test

我改成英文分号,还是报这些错误啊

麻烦你写代码的时候,请把输入法调成英文……你的括号,逗号,全是全角符

把这段拿去编译……

#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("%s\n", NAME);
    printf("%s\n", ADDRESS);
    printf("%s\n", PLACE);
    starbar();  /* 使用函数 */
    return 0;
}


void starbar(void)
{
    int count;


    for (count = 1; count <= WIDTH; count++)
        putchar('*');
    putchar('\n');
}



1
c
ccyuan
怎么感觉是 标点符号使用了中文的
0
c
candc2

; ; 

中文分号

cuiliu
cuiliu
没有啊,刚才全改一遍还是这个错误,是不是visual studio需要配置什么
0
bobdog1986
bobdog1986
楼上正解,别老用中文的注释,你写的这类注释用下英文也不错,这样就不用中文输入法了
0
L5_Railgun
L5_Railgun
你这个分号显然是全角符~
0
cuiliu
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("%s\n",NAME);
printf("%s\n",ADDRESS);
printf("%s\n",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:\Cworkspace\test\test\Test.c 7 6 test
7 IntelliSense: incomplete type is not allowed d:\Cworkspace\test\test\Test.c 19 6 test
6 IntelliSense: expected a ';' d:\Cworkspace\test\test\Test.c 10 1 test
8 IntelliSense: expected a ';' d:\Cworkspace\test\test\Test.c 20 2 test
Error 1 error C2182: 'starbar(void)' : illegal use of type 'void' d:\cworkspace\test\test\test.c 7 1 test
Error 3 error C2182: 'starbar(void)' : illegal use of type 'void' d:\cworkspace\test\test\test.c 20 1 test
Error 4 error C2054: expected '(' to follow 'starbar(void)' d:\cworkspace\test\test\test.c 20 1 test
Error 2 error C2054: expected '(' to follow 'main(void)' d:\cworkspace\test\test\test.c 10 1 test

我改成英文分号,还是报这些错误啊
0
上海什么大学
上海什么大学
你的括号都是全角的
0
r
rose-sdk
在整个代码页中,不管是代码还是注释,请切记全用英文,某则可能出不可预料错误。这错语不仅仅是不能看注释而已。顺便说下,在Visutal Studio执行菜单命令,File——Advanced Save Options...,可以察看当前页是用什么编码。
0
d
decentlife

for(count = 1; ount <= WIDTH; count++)

count != ount

返回顶部
顶部