新闻  |   论坛  |   博客  |   在线研讨会
帮忙,编译时为何总是提示如下错误?
hongye7999 | 2009-04-12 09:24:15    阅读:1497   发布文章

#include<iostream.h>
void swap(int *,int *);
void main()
{
  int a=3,b=4;
  cout<<"a="<<a",b="<<b<<endl;
  swap (&a,&b);
  cout<<"a="<<a",b="<<b<<endl;
}
void swap (int *x,int *y)
{
   int t=*x;
   *x=*y;
   *y=t;
}

为何总是提示如下错误?还请各位帮忙解释一下,不吝赐教!O(∩_∩)O谢谢
c:\documents and settings\administrator\my documents\vc\2\2.cpp(6) : error C2143: syntax error : missing ';' before 'string'
c:\documents and settings\administrator\my documents\vc\2\2.cpp(6) : error C2296: '<<' : illegal, left operand has type 'char [4]'
c:\documents and settings\administrator\my documents\vc\2\2.cpp(8) : error C2143: syntax error : missing ';' before 'string'
c:\documents and settings\administrator\my documents\vc\2\2.cpp(8) : error C2296: '<<' : illegal, left operand has type 'char [4]'
执行 cl.exe 时出错.

2.obj - 1 error(s), 0 warning(s)

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
展示自我,坚持!
最近文章
人在江湖
2012-03-11 22:07:23
X电容,Y电容作用
2010-02-11 22:57:36
推荐文章
最近访客