In function fun, I am allocating array A. The size of array is known at run time, I am wandering from which area A is getting memory. My wild guess is stack but I couldn't think of any reason for it.
#include<iostream>
using namespace std;
void fun(int n)
{
int A[n];
//do something with array
for(int i=0;i<n; i++)
cout<<A[i]<<" ";
cout<<"\n";
}
int main()
{
int n;
cin>>n;
fun(n);
return 0;
}