quick watching vector variable
-
how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible
9ine
9ine wrote:
how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible
It's quite easy. For eg: if you have an array like
int *pnData = new int[20];
// Fill out pData here Now select
pnData
and press Shift + F9 for quick watch window. This will only show you the first value. Now in order to see next value type the following...pnData[0] //--> Will show first element
pnData[1] //--> Will show second element
pnData[2] //--> Will show third element....Same with vector too... Select the variable that denotes the array in a vector, that is the internal data pointer in quick watch window. Now follow the same procedure that you did for
pnData
. Hope this helps...
Nibu thomas A Developer Programming tips[^] My site[^]
-
9ine wrote:
how in debug mode watch the contents of the vector<> it only shows first elemnt only, and not tmp[i] telling it is not possible
It's quite easy. For eg: if you have an array like
int *pnData = new int[20];
// Fill out pData here Now select
pnData
and press Shift + F9 for quick watch window. This will only show you the first value. Now in order to see next value type the following...pnData[0] //--> Will show first element
pnData[1] //--> Will show second element
pnData[2] //--> Will show third element....Same with vector too... Select the variable that denotes the array in a vector, that is the internal data pointer in quick watch window. Now follow the same procedure that you did for
pnData
. Hope this helps...
Nibu thomas A Developer Programming tips[^] My site[^]
-
Another option is in the watch window, use
pnData,20
That will show 20 elements. Hope that helps.Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
krmed wrote:
Another option is in the watch window, use pnData,20 That will show 20 elements.
This is real nice. Thanks for this info. I didn't know about this. A 5. Do you know any more of such tricks. :)
Nibu thomas A Developer Programming tips[^] My site[^]