Estou com um erro ao associar um endereço de uma matriz em um ponteiro para struct, estou recebendo um erro do tipo:
assignment to expression with array type
O código que estou utilizando é esse:
struct MaxHeap
{
int size;
int* array;
};
struct MaxHeap* createAndBuildHeap(char array[][25], int size)
int i;
struct MaxHeap* maxHeap =
(struct MaxHeap*) malloc(sizeof(struct MaxHeap));
maxHeap->size = size; // initialize size of heap
maxHeap->array = array; // Assign address of first element of array
// Start from bottommost and rightmost internal mode and heapify all
// internal modes in bottom up way
for (i = (maxHeap->size - 2) / 2; i >= 0; --i)
maxHeapify(maxHeap, i);
return maxHeap;
{}
. Aproveite e inclua também a definição da estruturamaxHeap
e a chamada aocreateAndBuildHeap