As we all know, we can write codes like this in C++:
int main() {
int n;
cin >> n;
int a[n];
...
}
But when the inputed n
is too large, this program will crash.
So,
- Why it would crash?
- What is the lowest value
n
to make it crash? - Why using
malloc
will not cause this problem?