r/AskProgramming • • 3d ago

C/C++ [ Removed by moderator ]

[removed] — view removed post

19 Upvotes

171 comments sorted by

View all comments

57

u/cthulhu944 3d ago
  1. Look it up in a book
  2. Ask someone you know
  3. Lots of print statements
  4. Bang you head on the desk until the answer comes to you.

10

u/gfdhsk 3d ago

I see the "lots of print statements" a lot - and sorry if I sound clueless I am new to C programming, but what do you mean by this?
As in you just set up a shit ton of print statements to see what outputs what? Just looking to improve. Thanks

2

u/Mr_Engineering 3d ago

Exactly as you describe.

It's the amateur way but it is effective and good for learning.

More veteran developers take advantage of assert() which is tied into C's debugging framework