Some simple code doesn't appear to be working, and I'm not sure why.
I'm dynamically creating an array of integers. The size of this array is shown as 15, but that's just because I'm trying to debug the program. The actual size is variable at runtime.
I browsed a few sites for how to dynamically create an integer array in C++. Sites like this one came up. Their code looks like my code: an array is created, and a for
loop sets the value of each element in the array.
But after my for loop runs, I get an array of size 0. What could be the problem?
This is an extremely basic C++ program compiling on Windows using Visual Studio.