头文件没有问题(同学可以用),为什么编译时提示头文件错误?程序如下: 5
主程序:typedefintElemType#include"stdarg.h"#include"stdlib.h"#include"iomanip.h"#include...
主程序:typedef int ElemType
#include "stdarg.h"
#include "stdlib.h"
#include "iomanip.h"
#include "Array.h"
void main()
{
Array a;
int i,j,dim=2,b1=3,b2=4;
ElemType e;
InitArray(a,dim,b1,b2);
cout<<"a.b=";
for(i=0;i<dim;i++)
cout<<setw(4)<<a.b[i];
cout<<endl;
cout<<b1<<"行"<<b2<<"列矩阵元素如下:"<<endl;
for(i=0;i<b1;i++)
{for(j=0;j<b2;j++)
{cin>>x;
Assign(a,x,i,j);
Value(e,a,i,j);
cout<<" "<<"a["<<i<<"]["<<j<<"]"<<=setw(2)<<e;}
cout<<endl;}
}
错误描述为c:\program files\microsoft visual studio\vc98\include\stdarg.h(36) : error C2144: syntax error : missing ';' before type 'int'
c:\program files\microsoft visual studio\vc98\include\stdarg.h(36) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
求大神解答 展开
#include "stdarg.h"
#include "stdlib.h"
#include "iomanip.h"
#include "Array.h"
void main()
{
Array a;
int i,j,dim=2,b1=3,b2=4;
ElemType e;
InitArray(a,dim,b1,b2);
cout<<"a.b=";
for(i=0;i<dim;i++)
cout<<setw(4)<<a.b[i];
cout<<endl;
cout<<b1<<"行"<<b2<<"列矩阵元素如下:"<<endl;
for(i=0;i<b1;i++)
{for(j=0;j<b2;j++)
{cin>>x;
Assign(a,x,i,j);
Value(e,a,i,j);
cout<<" "<<"a["<<i<<"]["<<j<<"]"<<=setw(2)<<e;}
cout<<endl;}
}
错误描述为c:\program files\microsoft visual studio\vc98\include\stdarg.h(36) : error C2144: syntax error : missing ';' before type 'int'
c:\program files\microsoft visual studio\vc98\include\stdarg.h(36) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
求大神解答 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询