471,089 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

visual c++ debug dinamic objects

gp
Hi all,

I'm using Microsoft Visual C++ 6.0,
I would like to see, debugging my project, all the elements of my dinamic
objects....

I have a dinamic array and a STL vector and I need to know the fields values
at a specific position, but in the Watch windows I can only see the first
element...

I tried putting in the watch window
vector_name
vector_name[k]
vector_name[5]
vector_name.at(k)
vector_name.at(5)
vector_name[5].field_name
....
etc....

but there's no way...

could anyone help me?
thanks...
Sep 14 '05 #1
6 1911

gp wrote:
Hi all,

I'm using Microsoft Visual C++ 6.0,
I would like to see, debugging my project, all the elements of my dinamic
objects....

I have a dinamic array and a STL vector and I need to know the fields values
at a specific position, but in the Watch windows I can only see the first
element...

I tried putting in the watch window
vector_name
vector_name[k]
vector_name[5]
vector_name.at(k)
vector_name.at(5)
vector_name[5].field_name
...
etc....

but there's no way...

could anyone help me?
thanks...


You'll have to dig into the implementation of their std::vector, but I
think it should be something like this:

*(vector_name._First+k)

Cheers! --M

Sep 14 '05 #2
gp wrote:
Hi all,

I'm using Microsoft Visual C++ 6.0,
I would like to see, debugging my project, all the elements of my dinamic
objects....

I have a dinamic array and a STL vector and I need to know the fields values
at a specific position, but in the Watch windows I can only see the first
element...

I tried putting in the watch window
vector_name
vector_name[k]
vector_name[5]
vector_name.at(k)
vector_name.at(5)
vector_name[5].field_name
...
etc....

but there's no way...

could anyone help me?
thanks...


<OT newgroups-to-try-in="*microsoft.vc*">
http://www.codeguru.com/Cpp/V-S/tips/article.php/c465/
</OT>
Sep 14 '05 #3
mlimber wrote:
gp wrote:
Hi all,

I'm using Microsoft Visual C++ 6.0,
I would like to see, debugging my project, all the elements of my dinamic
objects....

I have a dinamic array and a STL vector and I need to know the fields values
at a specific position, but in the Watch windows I can only see the first
element...

I tried putting in the watch window
vector_name
vector_name[k]
vector_name[5]
vector_name.at(k)
vector_name.at(5)
vector_name[5].field_name
...
etc....

but there's no way...

could anyone help me?
thanks...

You'll have to dig into the implementation of their std::vector, but I
think it should be something like this:

*(vector_name._First+k)


OT, but try:

(vector_name)._First,N

where N is the number of elements you think exist in 'vector_name'
(and yes, it is a comma)

/S.
Sep 14 '05 #4
gp
thanks!
(vector_name)._First,N works well with vectors!

do you know how can make the same thing with a dinamic classic array?
(i have a function which takes as parameter "array[]" and I would like to
know every array element...)


"Stefan Nwe" <na*****@atlas.de> ha scritto nel messaggio
news:4g***********@news01.atlas.de...
mlimber wrote:
gp wrote:
Hi all,

I'm using Microsoft Visual C++ 6.0,
I would like to see, debugging my project, all the elements of my dinamic
objects....

I have a dinamic array and a STL vector and I need to know the fields
values
at a specific position, but in the Watch windows I can only see the first
element...

I tried putting in the watch window
vector_name
vector_name[k]
vector_name[5]
vector_name.at(k)
vector_name.at(5)
vector_name[5].field_name
...
etc....

but there's no way...

could anyone help me?
thanks...

You'll have to dig into the implementation of their std::vector, but I
think it should be something like this:

*(vector_name._First+k)


OT, but try:

(vector_name)._First,N

where N is the number of elements you think exist in 'vector_name'
(and yes, it is a comma)

/S.

Sep 14 '05 #5
gp wrote:
thanks!
(vector_name)._First,N works well with vectors!

do you know how can make the same thing with a dinamic classic array?
(i have a function which takes as parameter "array[]" and I would like to
know every array element...)


array[5]
*(array+5)

Both should work. The trick here is that for std::vector, the []
operator is actually an implicit function call. For "classic" arrays,
the [] operator should work as usual in any debugger worth its salt.

Cheers! --M

Sep 14 '05 #6
gp wrote:
thanks!
(vector_name)._First,N works well with vectors!

do you know how can make the same thing with a dinamic classic array?
(i have a function which takes as parameter "array[]" and I would like to
know every array element...)


It's the same trick

array,N

The comma is the key.

john
Sep 14 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by dddddd | last post: by
reply views Thread by gerd | last post: by
3 posts views Thread by Jose Garcia | last post: by
10 posts views Thread by javuchi | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.