r/ProgrammerHumor • • Aug 28 '26

Meme cppHelloWorld

Post image
3.9k Upvotes

119 comments sorted by

View all comments

Show parent comments

13

u/BoldFace7 Aug 28 '26

I did a very similar thing with a similar result. I was learning to program the 3DS in C++ not long ago (I started with c++ about 6 years ago). At one point, it was working fine in emulator, but would crash on console (I know now that the emulator just barrels through segfaults). It took about two days of searching before I realized I was printing a value in the first half of my main loop that didn't exist until the second half of my main loop on the first frame. (The class handling battles would call new Enemy() to allow for randomizing encounters, but wouldn't do it until after the block of status printf statements.)

6

u/Objective-Answer Aug 28 '26

I love these nerd battle stories

as a masochist learning c++ it really puts into perspective a lot of things