菜鸟问题!!帮忙看一下这是什么错误!!!

shaxing 2007-05-02 09:33:36
谢谢了!!!




error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : error C2018: unknown character '0xa1'
d:\program files\microsoft visual studio\myprojects\lianxi\22.cpp(22) : fatal error C1003: error count exceeds 100; stopping compilation
执行 cl.exe 时出错.



Results
22.obj - 1 error(s), 0 warning(s)


还有好多类似的句子我把它省略了!!
...全文
248 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaxing 2007-05-02
  • 打赏
  • 举报
回复
果然跟monkeywuming() 说的一样!!谢谢了!
不想低调 2007-05-02
  • 打赏
  • 举报
回复
你这个程序只能进行一次运算。。
monkeywuming 2007-05-02
  • 打赏
  • 举报
回复
你那个程序是因编码不规范引起的错误~~我已经帮你改好了~~语法没有问题。。
可以联系QQ:252352963
不想低调 2007-05-02
  • 打赏
  • 举报
回复
单个文件,编译没错误
shaxing 2007-05-02
  • 打赏
  • 举报
回复
就是这个文件啊!studyall123(火箭!fighting)编译没有错误吗?
不想低调 2007-05-02
  • 打赏
  • 举报
回复
Compiler Error C2018:
unknown character 'hexnumber'
The ASCII character corresponding to the given hexadecimal number appeared in the source file but is an illegal character.
不想低调 2007-05-02
  • 打赏
  • 举报
回复
这个是22.cpp??给代码没有那个错误的
shaxing 2007-05-02
  • 打赏
  • 举报
回复
自己再顶一下!
shaxing 2007-05-02
  • 打赏
  • 举报
回复
这是文件代码!

#include <iostream.h>
int main()
{
 double displayed_value;
 double new_entry;
 char command_character;
 displayed_value = 0.0;
 cout << "计算器演示程序" << endl
 << "----" << endl;
 cout << "在'>' 提示后输入一个命令字符"
 << endl;
 cout << "Value : " << displayed_value << endl;
 cout << "command>";
 cin >> command_character;
 while (command_character != 'Q') {
   switch(command_character) {
     case 'C':
       displayed_value = 0.0;
       break;
     case '+':
       cout << "number>";
       cin >> new_entry; //提示的错误是这一行
       displayed_value += new_entry;
       break;
     case '-':
       cout << "number>";
       cin >> new_entry;
       displayed_value -= new_entry;
       break;
     case '*':
       cout << "number>";
       cin >> new_entry;
       displayed_value *= new_entry;
       break;
     case '/':
       cout << "number>";
       cin >> new_entry;
       displayed_value /= new_entry;
       break;
     default:
       cout << "不可理解的输入!";
       cin.ignore(100,'\n');
       } //End of switch
 cout << "Value : " << displayed_value << endl;
 cout << "command>";
 cin >> command_character;
} //End of while
return 0;
}
不想低调 2007-05-02
  • 打赏
  • 举报
回复
最好还是贴代码出来,不然别人只能乱猜了
believefym 2007-05-02
  • 打赏
  • 举报
回复
'0xa1',楼主是要十六进制整数还是一个字符呢,
int i = 0xa1即可,不用引号
char*c = "0xa1";

65,212

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧