473,230 Members | 1,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 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 2008

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dddddd | last post by:
i need do create simple dinamic site - built mainly of pictures(they are the only dinamic part). pictuers differ by the -Location- and by -Time- (in which they were taken)... so on the index...
0
by: gerd | last post by:
Hello, I want to port an MFC Application from Visual Studio 6 MFC application to Visual C++ 2005 express edition beta. While building i get following error: ------ Build started: Project:...
0
by: gerd | last post by:
Hello, I want to port an MFC Application from Visual Studio 6 MFC application to Visual C++ 2005 express edition beta. While building i get following error: ------ Build started: Project:...
7
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
3
by: Greg B | last post by:
Created a simple Win32 application (using Visual Studio wizard)... Am using Visual Studio (Enterprise Edition) 6.0, as well as Service Pack 5. At the start of 'WinMain' function, added the...
3
by: Jose Garcia | last post by:
Hi there, Can somebody explain me how can i use matrixes with dinamic memory? I use malloc and free (NOT new & delete). I want to access to the matrix like Matrix but i don't know how to do that...
0
by: saj14saj | last post by:
(If there is a better forum to post this in, please let me know...) I am using Visual Studio 2005. I have a Solution consisting of three projects: * A main project "DiscoverNotes" written in...
10
by: javuchi | last post by:
I just want to share some code with you, and have some comments and improvements if you want. This header file allocates and add and delete items of any kind of data from a very fast array: ...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.