Showing posts with label comments. Show all posts
Showing posts with label comments. Show all posts

Friday, March 22, 2013

C Comment Fun

This post has moved! Click here to view the new home of this post.

Hello, I was wasting time doing silly things so I thought I would let you in on the fun.

Occasionally, even my programs have a error when I run them for the first time. You can of course whip out the debugger but sometimes it is quicker and easier to add a diagnostic print statement. Now you have solved your problem and remove the statement, but what if you want it again? You could use a fancy logging framework where you can turn on and off debug messages for sections of your code but that is often overkill. That is where the following commenting techniques come in. These work with C style languages provided you have both C (/* */) and C++ (//) style comments at your disposal.