Click to See Complete Forum and Search --> : Adding a watch for a pointer (that points to an array)?


SigEpUCI
April 29th, 2003, 03:31 PM
I have a pointer (int*) that points to an array of elements.
If i add the pointer to the watch window, as expected i only see the address of the beginning of the array. I seem to remember that there is a way to key the name in the watch window so it treats the pointer as an array and allows you to see all of indices. Anyone know how to do this?

Tia
Jeff

mdmd
April 30th, 2003, 08:02 AM
for something like

int* a = new int[10];

Watch window format would be

a,10 ( or any number of eles you want to see );

Stern_Pea
April 30th, 2003, 09:03 AM
Yes, if you are using Visual c++
int* a = new int[10];
in "Watch" tool bar
a,n (n is the number of of the first n element of array)
a[n] (n is the index of array)
enjoy it :D