-
Highlighting Braces...
Hi, I am using windows XP and the Microsoft Visual C++, and I was wondering if in that there is a way to highlight braces ... does anyone know how to do that with visual c++? it's no big deal really, it's just that I find it much easier to debug and whatnot for loops.
-
I don't think it will highlight them, but if you put the cursor on one then press Ctrl+']' the cursor will jump to the opening/closing one. Sometimes it messes up if there are braces enclosed in quotes. It works with parentheses and brackets too.
-
thanks! that's just as good!!
-
If you get into the habit of typing such things in pairs, say
Code:
/**/
for(;;){
printf("");
}
Then you'll know the things are always going to be balanced before you do anything else.
What's more, you can map out the overall structure of a function with just empty blocks like this, and it will compile.
There's nothing worse than lots of crappy indented code with missing braces, closing comments or whatever.
Code:
void foo ( )
{
/* blah blah */
for ( more blah )
{
/* lots of blah
if ( some other blah )
{
}
Sure you can add a brace or two, but was that if() really part of the for loop or not?
And is it still part of the for loop when you've finished guessing where the braces go. Sure there are plenty of options when it comes to making the thing compile, but only one combination will make the code do what you want.
-
Some text editors will highlight matching braces for you.
-
I like this one Notepad++ . It will highlight your braces for you, syntax highlighting, ect... Just posting because I've found it multipurpose and quite useful.