关于int main(int argc,char *argv[])怎么运行呢,谢谢,比较急
我们文件compile的时候没有问题,但是我不知道怎么运行就是不知道怎么输入argc和argv。
我的main.cpp 文件是
/******************************************************************/
#ifndef MATRIX__H
#define MATRIX__H
class Vector{
public:
int length;
double * elements;
/* Vector(int n){ */
/* length = n; */
/* elements = new double[length]; */
/* for(int i = 0; i < length; i++) */
/* elements[i] = 0; */
/* } */
Vector(){;}
void Assign(int n){
length = n;
elements = new double[length];
for(int i = 0; i < length; i++)
elements[i] = 0;
}
~Vector(){
delete [] elements;
}
};
class Matrix{
public:
int length;
Vector * rowVectors;
Matrix(int m, int n){
length = m;
rowVectors = new Vector[length];
for(int i = 0; i < length; i++){
rowVectors[i].Assign(n);
}
}
};
#endif
我的header 文件是
/**********************************************************************/
#ifndef MATRIX__H
#define MATRIX__H
class Vector{
public:
int length;
double * elements;
/* Vector(int n){ */
/* length = n; */
/* elements = new double[length]; */
/* for(int i = 0; i < length; i++) */
/* elements[i] = 0; */
/* } */
Vector(){;}
void Assign(int n){
length = n;
elements = new double[length];
for(int i = 0; i < length; i++)
elements[i] = 0;
}
~Vector(){
delete [] elements;
}
};
class Matrix{
public:
int length;
Vector * rowVectors;
Matrix(int m, int n){
length = m;
rowVectors = new Vector[length];
for(int i = 0; i < length; i++){
rowVectors[i].Assign(n);
}
}
};
#endif