Cannot watch dynamic array elements in C++ with /clr
Christian Scheffler
1
Reputation point
I have a problem debugging elements of dynamic arrays in VS C++. using the watch window which obviously does not work with Windows Forms.
In the example below all array elements can be seen using arr,5 in the debugger watch window compiling a console application. However, this is not the case, for instance, in a button click event function working with Windows forms. In this case only the first element can be listed.
What's wrong?
//Example:
int* arr = new int[5];
for (int i = 0; i < 5; i++)
arr[i] = std::rand() % 100;
return 0;
Sign in to answer