16
nickj
7y

my code went into an infinite loop of printing "fuck". that happens when u forget to put curly braces and the first line after the if statement is printf("fuck\n");

Comments
  • 0
    How can you *forget* curly braces? XD
  • 1
    Have you tried turning it off and on again?
  • 2
    @dontPanic i was debugging to make sure it entered the if statement. i didnt have to put the curly braces because there was only one line after that but adding the printf makes 2 lines, thus the need of { } xD
  • 1
    @nickj haha
    Remember to delete that printf("fuck\n"); before you push to production. I'm talking from experience xD
  • 2
    @dontPanic the truth. I once pushed a icon that was a place holder picture. Which was a fuck this boss meme. It went over well in the programmers meeting. We all learned a valuable lesson. Placeholders should be pictures of cute kittens.
  • 0
    @nickj even if there is only one line its better to put curly braces when u use if, while, for.
Add Comment