i am trying to return an array from this code, so that i can later create an array of arrays, in another method i'm writing...
int getValues(char *userInputPtr) {
int i = 1;
float fp = 0;
float num = atof(userInputPtr);
float *arrayOfFloats = (float *)malloc(sizeof(float) * num);
for ( i ; i <= num ; i++ ) {
scanf(" %f", &fp);
arrayOfFloats[i] = fp;
printf(" %f", arrayOfFloats[i]);
}
printf("\n");
return arrayOfFloats;
}
i keep getting the error: warning: return makes integer from pointer without a cast. i just want to return the array! what gives? :/