Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

GDB print c++ vector

+1 vote
asked Jan 21, 2020 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, 2020 by Jan Christoph Uhde
Yes see the GDB wiki: http://sourceware.org/gdb/wiki/STLSupport

you can find the pretty printers at svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python

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.
...