On this line of code *m = arrayAllocator(size); I am getting an error, line 12, for *m saying that "a value of type "int" cannot assigned to an entity of type "int". I am trying to return a point to an array from a function.
int *arrayAllocator(int);
int main()
{
int size;
int *m;
cout << "How big is the array" << endl;
cin >> size;
*m = arrayAllocator(size);
return 0;
}
int *arrayAllocator(int s){
int *arry;
//dynamic memory
arry = newint[s];
//storing numbers in the array with a loop
for (int i = 0; i < s; i++){
cout << "What is the values being stored? " << endl;
cin >> arry[i];
}
return arry;
}