Board index » cppbuilder » Seeing vector's numerical content in watch list window

Seeing vector's numerical content in watch list window

Heps

In my C++ Builder 5.0 I can see the content of numerical vectors in the
watch list window, but I don't recall how I made it do that, so how do I set
it in C++ Builder 6.0?
Example code:
std::vector<long double> Test;
 for(int i=0; i<10; ++i)
 Test.push_back(i/1.56);
  long double T;
 ////breakpoint, but watch list gives me:
Test[1]: E2451 Undefined symbol '_STL::vector<long double,
_STL::allocator<long double> >::_STL::vector<long double,
_STL::allocator<long double> >::operator [](unsigned int)';

And I want to see the numerical value of Test[1]
--

Regards
Torben Laursen
tlaur...@equia.com

 

Re:Seeing vector's numerical content in watch list window


Quote
Torben Laursen wrote:
> In my C++ Builder 5.0 I can see the content of numerical vectors in the
> watch list window, but I don't recall how I made it do that, so how do I set
> it in C++ Builder 6.0?
> Example code:
> std::vector<long double> Test;
>  for(int i=0; i<10; ++i)
>  Test.push_back(i/1.56);
>   long double T;
>  ////breakpoint, but watch list gives me:
> Test[1]: E2451 Undefined symbol '_STL::vector<long double,
> _STL::allocator<long double> >::_STL::vector<long double,
> _STL::allocator<long double> >::operator [](unsigned int)';

> And I want to see the numerical value of Test[1]

You are using operator[] of vector for the evaluation. Because you don't
use operator[] in the program, the de{*word*81} can't find it and use it for
evaluation.

To use Test[1] in the watch list you have to either use operator[] of
vector in the program or use Test._M_start[1] instead, which will give
the same result.

Ivan Johansen

Other Threads