C/C++ Debugging Tip

in #programming6 years ago

I'm not sure when I discovered this, or if I've ever seen this posted anywhere, but this is a simple trick with multi-line comments I use when debugging code:

//*
Uncommented code
/*/
Commented code
//*/

To change this around, just remove the first /:

/*
Commented code
/*/
Uncommented code
//*/

What is going on is /*/ will always toggle commented to uncommented and vice versa. //*/ always ends a multi-line comment without causing a syntax error if there wasn't a multi-line comment before it.

Sort:  

Congratulations @teknomunk! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64400.33
ETH 3140.71
USDT 1.00
SBD 3.93