r/programming • u/MegaGreenLightning • Oct 14 '26
A C++ Trick Question - Blog Post
https://greenlightning.eu/programming/cpp-trick-question/
100
Upvotes
r/programming • u/MegaGreenLightning • Oct 14 '26
24
u/tuxwonder Oct 14 '26
I understand why this happens, but it just feels like a very silly problem that should be solveable
20
u/rbobby Oct 15 '26
C++ is just a trick C question taken too far.
23
u/AntimatterTNT Oct 14 '26
absolutely not tricky. there's a reason you dont do shit like this
3
u/initcommit Oct 16 '26
Oooo, technically interesting!
3
u/obetu5432 Oct 15 '26
every c++ question is a trick question
3
u/shunya_sekiguchi Oct 15 '26
This is why code reviews exist. The moment someone introduces self-referencing
shared_ptrchains without thinking about destruction depth, you know you're in for a fun debugging session.1
u/PandaWonder01 Oct 18 '26
This isn't a C++ question, it's a question about OS stack limits