i am trying to make an array where user choses the size, and i dont seen able to get it right. What am I doing wrong?
Code:
#include <stdio.h>
#include <stdlib.h>
double* makeAnArray(double size);
int main (){
int anArray()={0};
int size=0;
printf("Please enter the size of the array");
scanf("%i", &size);
makeAnArray(size);
free(anArray);
getchar();
}
double* makeAnArray(double size){
int* array;
array =calloc(size,sizeof(double));
return *array;
}