I'm confused totally...
Ok, I create the class with the array:
ref class my_child
{
public:
array<int>^ mas_1D;
my_child() // constructor
{
mas_1D = gcnew array<int>(10);
};
};
Next, I create one more class with the variables of the previous class:
ref class Father
{
public:
my_child dear_baby; // 1-st variable
array<my_child^>^ dear_son; // 2-nd variable-array
Father() // constructor
{
dear_son = gcnew array<my_child^>(5);
};
};
Next I define this class variables (in the programm body) and try to change it:
Father F;
F.dear_baby.mas_1D[1] = 12; // works properly
F.dear_son[1]->mas_1D[1] = 23; //error!
There are no problem during compilation.
The "dear_baby" calls without any problem.
But the programm stops on the 3. string and shows error:
In the instance of the object reference not set to an object.
Something is wrong with "dear_son".
Thank you!