suppose int xyz[10000] is an array.
and we are using IDE Visual C++ 6.0
during debugging we can add xyz to watch window, it will show the whole array, when expanded.
If the array is large, it becomes slow when expanded and debugging becomes tiresome.
So how to view part of the array, say we want to watch
xyz[5500] to xyz[5599] only during debugging. is their any way ?
Debugging in VC++ : Watching Part of an array
Moderator: Board moderators
Debugging in VC++ : Watching Part of an array
μδ. ταηνιπ αλ αμιη
Re: Debugging in VC++ : Watching Part of an array
Something along the line of:popel wrote:suppose int xyz[10000] is an array.
and we are using IDE Visual C++ 6.0
during debugging we can add xyz to watch window, it will show the whole array, when expanded.
If the array is large, it becomes slow when expanded and debugging becomes tiresome.
So how to view part of the array, say we want to watch
xyz[5500] to xyz[5599] only during debugging. is their any way ?
[c]
*(int (*)[100]) &xyz[5500]
[/c]
works with gdb.
Ciao!!!
Claudio
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact:
Oi,Pops,
This works:
&arr[10],5
Suppose arr[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}
then &arr[10],5 will show the following:
&arr[10],5
[0]=11
[1]=12
[2]=13
[3]=14
[4]=15
You have to simply give the address followed by a coma and then the number of members to be viewed.
PS: I think this is a new feature of VC++.Net 2003. I don't know if it works on previous versions.


This works:
&arr[10],5
Suppose arr[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}
then &arr[10],5 will show the following:
&arr[10],5
[0]=11
[1]=12
[2]=13
[3]=14
[4]=15
You have to simply give the address followed by a coma and then the number of members to be viewed.
PS: I think this is a new feature of VC++.Net 2003. I don't know if it works on previous versions.
We will, We will BREAK LOOP!!!!
xyz+5500,100
It seems it will work with VC++ 6.0, the debugger takes it but no effect.
casting the array to smaller size should work, but I couldn't make it work.
So I use the alternate way (its also casting)
[cpp]
int (*p)[100]; /* keeping this in code */
[/cpp]
during debugging when i need p = xyz+5500, makes it happen.
something like (int (*)[100])(xyz+5500) should also also work.... but I don't know why it says "missing operator"
It seems it will work with VC++ 6.0, the debugger takes it but no effect.
casting the array to smaller size should work, but I couldn't make it work.
So I use the alternate way (its also casting)
[cpp]
int (*p)[100]; /* keeping this in code */
[/cpp]
during debugging when i need p = xyz+5500, makes it happen.
something like (int (*)[100])(xyz+5500) should also also work.... but I don't know why it says "missing operator"

μδ. ταηνιπ αλ αμιη
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact:
-
- New poster
- Posts: 45
- Joined: Fri Jan 16, 2004 7:02 pm
- Location: CSE::BUET
- Contact: