+ 2
Dynamic size array
i have a way to do that. int x = 10; const int &y = x; int arr[y]; x = 100; arr[80] = 99; the size is really change. but is this a good idea?
1 Answer
+ 6
The size did not change, you did a buffer overflow
Use malloc/realloc / free instead of "false static" arrays