Код: Выделить всё
queue q;
float A[2][3] = {{0, 1, 2}, {10, 20, 30}};
printf("Value from array %f\n", A[1][0]);
q.push( (float**) A );
printf("Array A added to the queue \n");
printf("Value from the queue %f\n", q.front()[1][1]);
float el2[2][3] = {{1.5, 1.6, 0.7}, {2.5, 2.6, 2.7}};
Код: Выделить всё
Value from array 10.000000
Array A added to the queue
Segmentation fault (core dumped)
Код: Выделить всё
queue q;
float A[2][3] = {{0, 1, 2}, {10, 20, 30}};
printf("Value from array %f\n", A[1][0]);
q.push( (float*) A );
printf("Array A added to the queue \n");
printf("Value from the queue %f\n", ((float**)q.front())[1][1]);
Подробнее здесь: https://stackoverflow.com/questions/791 ... thout-c-20