这句话 我写错了么。
# include <stdio.h>int main(void)
{
int i;
i = 3;
printf(“i = %d\n”,i);
return 0;
}
这段我写错了么 用VC++ 调试出错
小白求指教
错误代码:
--------------------Configuration: 变量 - Win32 Debug--------------------
Compiling...
变量.cpp
E:\C实验\变量.cpp(5) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(5) : error C2018: unknown character '0xbb'
E:\C实验\变量.cpp(6) : error C2146: syntax error : missing ';' before identifier 'i'
E:\C实验\变量.cpp(6) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(6) : error C2018: unknown character '0xbb'
E:\C实验\变量.cpp(7) : error C2146: syntax error : missing ';' before identifier 'printf'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa1'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xb0'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa5'
E:\C实验\变量.cpp(7) : error C2017: illegal escape sequence
E:\C实验\变量.cpp(7) : error C2065: 'd' : undeclared identifier
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa1'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xb1'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xac'
E:\C实验\变量.cpp(7) : error C2146: syntax error : missing ')' before identifier 'n'
E:\C实验\变量.cpp(7) : error C2664: 'printf' : cannot convert parameter 1 from 'int' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\C实验\变量.cpp(7) : error C2059: syntax error : ')'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(7) : error C2018: unknown character '0xbb'
E:\C实验\变量.cpp(8) : error C2018: unknown character '0xa3'
E:\C实验\变量.cpp(8) : error C2018: unknown character '0xbb'
E:\C实验\变量.cpp(9) : warning C4508: 'main' : function should return a value; 'void' return type assumed
执行 cl.exe 时出错.
变量.exe - 1 error(s), 0 warning(s)
如果你复制的就是你写的代码 那就把分号换成英文分号 沙发正解,分号错误。 楼上说的对,而且你确定你vc都加载好了么 int main(void)
{
int i;
i = 3;
printf("i = %d\n",i);
return 0,
}
主要不要在中文输入法写符号 Pointer 发表于 2015-5-8 10:51
int main(void)
{
int i;
哦哦 谢谢哈。
页:
[1]