"); //-->
#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)
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。