I want to create an array on the stack that varies in size at runtime. As far as I know, this is always illegal in c++:
void local_array(unsigned int i) {
int arr[i];
}
However, it is possible to dynamically allocate memory on the stack using recursion. Is there a different way to accomplish this without using recursion? If not, what are the technical limitations preventing the example above from being realized?