//*
Some code
more code
even more code
//*/
/*
Some code
more code
even more code
//*/
Neat commenting trick i just discovered.
If you have commented out segments of code you want to toggle on and off you can do this.
Start of with the regular "/*" but end your the section with "//*/"
Now if you want to toggle change "/* to "//*"
Looks like it doesnt work in the forums source tags.
Neat
i do:
#define DEUBG_1 1
#define DEBUG_2 0
#if DEBUG_1
...
...
#elif DEBUG_2
...
...
#endif
most development editors have mass commenting in and out for selections, VSC++, emacs.
i do:
#define DEUBG_1 1
#define DEBUG_2 0
#if DEBUG_1
...
...
#elif DEBUG_2
...
...
#endif
most development editors have mass commenting in and out for selections, VSC++, emacs.
Quote:Original post by iminyourbrain
most development editors have mass commenting in and out for selections, VSC++, emacs.
Yeah I know that. Though this does have a certain convenience to it. With those you have to highlight the entire section of text first. With this each segment of comment is controlled with one key stoke an the that control is placed right at the start of the code segment. And you don't have to hunt for the close comment. Also When the code is toggled on it still marks that code as something you may want to turn off later if you forgotten about it.
If you want to toggle between two pieces of code you can even use:
[COOL]
/*code A/*/code B //active//*///*code A //active/*/code B//*/
[COOL]
Quote:Original post by samvOh, very nice. I'm sure ill make use of this.
If you want to toggle between two pieces of code you can even use:/*code A/*/code B //active//*///*code A //active/*/code B//*/
[COOL]
Instead of using comment, I usually do sth like this:
#if 0 // toggle to switch
// disabled code
#else
// enabled code
#endif
#if 0 // toggle to switch
// disabled code
#else
// enabled code
#endif
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement