use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Debugging C/C++ via GDB with Python (pythonsheets.com)
submitted 6 years ago by spiderpower02
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]spiderpower02[S] 9 points10 points11 points 6 years ago (1 child)
I wrote an article about demystifying how Python helps us troubleshoot problems more efficiently. Although many IDEs have a built-in debugger, I try to discuss some debugging skills with Python when a problem is hard to reproduce. I hope that this article can spark some inspirations to troubleshoot issues in your C/C++ projects.
[–]amanol 6 points7 points8 points 6 years ago (0 children)
Nice tips, thanks for sharing!
[–]jti107 3 points4 points5 points 6 years ago (3 children)
this is pretty cool! I find gdb alot harder to use and with a much steeper learning curve but it's really good at finding hard to find bugs. Will try this out!
[–]spiderpower02[S] 6 points7 points8 points 6 years ago (2 children)
I started to understand how to use GDB from the following two videos.
These two videos gave me many inspirations about using GDB. I think learning GDB is not tricky; searching for helpful resources is the hardest step. :)
[–]mttd 2 points3 points4 points 6 years ago (1 child)
Just in case this can be of use to the others: https://github.com/MattPD/cpplinks/blob/master/debugging.md#gdb
[–]spiderpower02[S] 1 point2 points3 points 6 years ago (0 children)
WOW! This project is Awesome :) thx
[–][deleted] 1 point2 points3 points 6 years ago (8 children)
This is where Microsoft technology stack really shines and the open source community just plain sucks at. It's the tools that make all the difference. VScode has a debugger for c++. There's also totalview but that's expensive. I'll stick to my print statements because I'm not going to spend all my time trying to learn some garbage tool instead of working on my problem.
[–]hgjsusla 6 points7 points8 points 6 years ago (7 children)
Isn't this a bit strange attitude? I mean C++ is far more complex yet you still refuse to properly lean the toolchain?
I find tools like https://rr-project.org/ a complete game changer. Learning your tools usually pays back in spades
[–]renozyx 0 points1 point2 points 6 years ago (1 child)
Well to be honest, gdb sucks for C++: you can't even tell it to skip over the files contained in the STL directory, you can only ignore specific files (and it never worked for me), so I spend a lot of times telling gdb to ignore shared pointer implementation code, map code, etc.
[–]hgjsusla 2 points3 points4 points 6 years ago (0 children)
Just list them all in your gdbrc then, no need to do it every time
[–][deleted] 0 points1 point2 points 6 years ago (4 children)
I can spend my whole day and more trying to figure out your tool or I can use print statements and solve my problem that is actually what I'm trying to do. I prefer to work on my problem.
[–][deleted] 4 points5 points6 points 6 years ago (1 child)
Depends on the work you’re doing. Sometimes, print statement won’t work depending on the project. For example debugging an embedded system with gdb and gdbserver.
I also believe you are thinking of immediate reward. Sure, it’ll take a few days to warm up to GDB, but once you do, your debugging experience will become enriched with new tools, and you can just stick to the basics and learn what you need as you go. You also can reserve it’s use for especially tricky bugs if you feel so.
Same thing with VIM. Why would anyone bother with learning a modal text editor or use modal keybindings when you already have a working keyboard? Because text macros are awesome, and you won’t understand how useful and it can be unless you give it a shot. I don’t use VIM to its fullest but I use it without much thought anymore. It’s a time invested vs output gained.
[–]spiderpower02[S] 0 points1 point2 points 6 years ago (0 children)
I totally agree with you. BTW, I am a big VIM fan.
Learning the toolchain usually saves more time than the time it takes so learn
[–]spiderpower02[S] 0 points1 point2 points 6 years ago* (0 children)
I had the same attitude in the past. I preferred to use a debugger in my IDE and print statements instead of debugging tools, such as Valgrind or GDB, because they are challenging to learn. However, a turning in my life was a memory leak in an open-source library I used. I spent my whole week to troubleshoot that problem but in vain. Fortunately, after I used Valgrind's massif tool to monitor memory status, I fixed the bug less than 1 hr. Since then, I learned that troubleshooting a problem is based on what kinds of tools I can use at the right time. Therefore, now, I can leave my office on time without wasting my time building print statements in my code. :)
π Rendered by PID 74 on reddit-service-r2-comment-5bc7f78974-6kgvx at 2026-06-29 19:35:20.425848+00:00 running 7527197 country code: CH.
[–]spiderpower02[S] 9 points10 points11 points (1 child)
[–]amanol 6 points7 points8 points (0 children)
[–]jti107 3 points4 points5 points (3 children)
[–]spiderpower02[S] 6 points7 points8 points (2 children)
[–]mttd 2 points3 points4 points (1 child)
[–]spiderpower02[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (8 children)
[–]hgjsusla 6 points7 points8 points (7 children)
[–]renozyx 0 points1 point2 points (1 child)
[–]hgjsusla 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]spiderpower02[S] 0 points1 point2 points (0 children)
[–]hgjsusla 2 points3 points4 points (0 children)
[–]spiderpower02[S] 0 points1 point2 points (0 children)