I'm having an error while associating an array address in a pointer to struct, I'm getting an error of type:
assignment to expression with array type
The code I'm using is this:
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;