I'm trying to increase a static array by doubling it dynamically in another array as soon as it is maxed. I planed on created new array with malloc(), then copy values over. Once done, I planned on deleting first array and then pointing first pointer to second?
float FirstArray[1];
if (first array is full) {
float *TempArray = (float*) malloc (sizeof (float) * counter);
for (loop) {
TempArray[i] = FirstArray[i];
}
//I'm not sure how to point the static array to the dynamic one
free(FirstArray);
*FirstArray = &TempArray;
//i get this error with line above
//assignment makes integer from pointer without a cast
}