I'm debugging my programs using Code::Blocks and I'm facing following issue: I do not see vector's members in Watches.
Why is this happening? How do I deal with it?
1 Answer
You need to install python pretty printers on the gdb version you are using to be able to display the content of vectors correctly, see this link.
printf/cout. In your code, it seems that you're possible trying to index beyond the bounds of the vector. Dont forget that vector.size() returns the number of elements, the last one is accessed with vector[vector.size()-1]. Since you're accessing both[i]and[i+1], you need to bail if your i ever reachesvector.size() - 2(I dont know whatcountholds, it may be something else entirely) - OffTopic: thanks for alerting me that GDB is functional in C::B under windows. Haven't used GDB in over 15 years. :)