Hi,
first of all, thank all for your help and replies to my question. Sorry for my delayed answer, but I am here in Calgary and -8h behind European time
However, here the code which I was using for testing:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector<string> vstr;
int main()
{
vstr v;
v.push_back("1. bla bla");
v.push_back("2. bla bla");
v.push_back("3. bla bla");
int a[3] ={11, 22, 33};
for (unsigned int f = 0; f<3; f++)
{
cout <<" a[" << f <<"] = " << a[f];
cout << " and v[" << f << "] = " << v[f] << endl;
}
return 0;
}
I played around with "Add watches" and I was not able to get a similar debugger output of a string vector compared to the output of a normal array (see screen-shot-1.png).
The only thing which was working for the string vector was the "element view" i.e. "Add wachtes --> v[0] (see screen-shot-1.png).
But with this method you have to be very carefully, since if you enter a element which does not exist i.e. out of array range, you will get a "segmentation signal" from Code::Blocks. (see v[3] in "wachtes in screen-shot-1.png and signal in screen-shot-2.png). So for me this "element view" method is not a 100% good way, it is more a 80% provisional solution
However, it would be very convenient if the debugger would show the string vector similar like the array (see "a" in watches --> screen-shot-1.png).
Thanks
Martin
PS: @ Jens
special thanks to you for providing debian-repository for Code::Blocks.
I use Debain Lenny, and this is a very convenient way to be up to date with Code::Blocks nightly builds.
Small suggestion for your page
http://apt.jenslody.de/ :
instead of this line:
--------------------------------------------------------------------------------------------
...The best and easiest way to add my public-key to apt's trustdb is to install the package jens-lody-debian-keyring with your preferred package-manager or apt-get. ....
--------------------------------------------------------------------------------------------
write it more explicitly like:
--------------------------------------------------------------------------------------------
... The best and easiest way to add my public-key to apt's trustdb is to install the package jens-lody-debian-keyring with
#apt-get-get install jens-lody-debian-keyring
or
#aptitude install jens-lody-debian-keyring
--------------------------------------------------------------------------------------------
Since most people do not read a web page they skim it.
[attachment deleted by admin]