(Corresponds to this question .)
I have a base class Baseand two derived classes Der1and Der2. (See the related question for a basic implementation. Each also has a number of public properties.) In my program, I create an array Baseas follows:
Base *array[10];
int count = 0;
Then later I populate it with instances Der1and Der2as follows:
Der1 d = Der1();
d.x = 0;
d.y = 1;
d.z = 3;
array[count] = &d;
count++;
Next to the identical code is used Der2.
Much later, I use an array to call functions defined in these classes:
int result = array[i]->SomeFunction(x, y);
My code compiles fine, but when I try to run it, I get "Unhandled exception in 0x00232d60 in file program.exe: 0xC000005: location of the violation of access 0x04064560".
, , 0,0000 , . double -type, , ( "1.572398880752e-311 # DEN" "-9.2559631349317831e + 061" ).
.NET , , , , ... , ?