|
-
September 12th, 2008, 02:06 AM
#1
Bracket Confusion
Hello, i am mostly used to programming in visual basic 6. As you know this is a huge change from c++. My biggest problem with learning C++ is the brackets. I no that you can go through your program to find out which brackets correspond with what but i find it extremely confusing.
If you cannot understand what im talking about ive put some code below.
{
code
{
more code
}
code
{
{
}
{
I know that makes no sense. But basically with a lot of if statements i find it extremely hard to find out which "sub" it is referring to. When i was in java the program i was using would highlight the corresponding bracket. I found this extremely useful. How do you guys deal with this? did you just learn to figure it out or is there some option i can turn on.
-
September 12th, 2008, 02:10 AM
#2
Re: Bracket Confusion
First, if the code is indented, then it should be easier.
Code:
{
code
{
more code
}
code
{
{
}
}
}
Anyway, AFAIK Visual Studio does this highlight too. Though I'm not 100% sure, since I always use Visual Assist which definitely does it.
-
September 12th, 2008, 03:46 AM
#3
Re: Bracket Confusion
Visual Studio highlights the first bracket or paren when you enter the last one. It just makes it bold it isn't vey distinguishable but it works.
But the real solution is like Cliu says. Indent properly and it becomes pretty trivial.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|