I am writing a fake banking program. In the function below I declare a dynamic array.
void trArr(int transactions)
{
int n;
string* accUse = new string[transactions];
return;
}
I try to access the array in a later function but I get the error "not declared at this scope. I thought that the array would be on the heap as opposed to the stack and would still exist after the function returns. Is this wrong?