主题:标识符错误
#include <iostream>
using namespace std;
class Vector
{
private:
int *len;
int length;
public:
Vector()
{
len=NULL;
length=0;
}
Vector(int l)
{
len=new int[l];
length=l;
}
void input()
{
cout<<"please input "<<length<<" intagers:"<<endl;
for (int i=0;i<length;i++)
cin>>len[i];
}
void display()
{
cout<<"(";
do
{
int i=0;
cout<<len[i]<<",";
i++;
}
cout<<")";
____________________________________________________________________________-_______
}
~Vector()
{
if (len!=NULL)
delete len;
}
};
void main()
{
Vector Vec1(6);
Vec1.input();
Vec1.display();
}
正在写一个模板向量类,过程中提示“\矩阵\向量\123\123.cpp(35) : error C2061: syntax error : identifier 'cout'”,就是划线行上面的,不知道什么原因,怀疑是中文符,但修改后还是一样
using namespace std;
class Vector
{
private:
int *len;
int length;
public:
Vector()
{
len=NULL;
length=0;
}
Vector(int l)
{
len=new int[l];
length=l;
}
void input()
{
cout<<"please input "<<length<<" intagers:"<<endl;
for (int i=0;i<length;i++)
cin>>len[i];
}
void display()
{
cout<<"(";
do
{
int i=0;
cout<<len[i]<<",";
i++;
}
cout<<")";
____________________________________________________________________________-_______
}
~Vector()
{
if (len!=NULL)
delete len;
}
};
void main()
{
Vector Vec1(6);
Vec1.input();
Vec1.display();
}
正在写一个模板向量类,过程中提示“\矩阵\向量\123\123.cpp(35) : error C2061: syntax error : identifier 'cout'”,就是划线行上面的,不知道什么原因,怀疑是中文符,但修改后还是一样