私はプログラムに取り組んでおり、オブジェクトの配列を作成する必要があります。具体的には、各位置がオブジェクトである31x1配列があります(各オブジェクトは基本的に6つのintで構成されています)。これが私が持っているものですが、何かが間違っているので、助けてくれてありがとう。
31x1構造体ヘッダー」
const int days=31;
struct Arr{
int days;
int *M;
};
typedef Arr* Array;
31x1行列コンストラクター:
void constr(){
int *M;
M = new Expe[31]; // Expe is the class
クラスヘッダー:
class Expe {
private:
//0-HouseKeeping, 1-Food, 2-Transport, 3-Clothing, 4-TelNet, 5-others
int *obj;
}
クラスオブジェクトコンストラクター:
Expe::Expe() {
this->obj=new int[6];
}
助けてください...私はかなり迷っているので。