Hello I am trying to allocate a dynamic array of length that the user inputs. I have a function to this for me but it doesn't allocate the number that I want it to allocate. For example, when I input one it gives me 7 digits...
heres the code:
int* Allocate(int& digits)
{
cout << digits << endl;
int* hold;
hold = new int[digits];
for (int i = 0; i < digits; i++)
{
cout << *hold;
hold++;
}
cout << endl;
return hold;
}
I can't find out anything thats wrong. The number of digits is getting passed correctly..,