GDB print c++ vector

0 votes
asked Jan 21 by CutePoison
In general on my linux PC, I am unable to display c++ vectors with just a print command on GDB
(gdb) print vec

-> this displays lot of junk

but on this online compiler, it seems to work and very neatly display the vector contents
Are you running some python script in the background, if so can you share it ?

Kindly help

1 Answer

0 votes
answered Jan 22 by Jan Christoph Uhde
Yes see the GDB wiki:

you can find the pretty printers at svn co svn://

and they are indeed python scripts.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.