By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,238 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,238 IT Pros & Developers. It's quick & easy.

Tips needed - How do I match the "{" with "}"

P: n/a
Hi

How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.

Thanks

Nov 7 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
2005 said:
Hi

How do I match the "{" with "}"
This is to math the loop begin and end.
You press % - which also works for ( ) and [ ] of course.

(I presume you're using vim, like any sensible C programmer.)
There is a command/short cut (say ALT F5) I used but I forgot.
I dare say you could map ALT F5 to it if you wanted.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Nov 7 '06 #2

P: n/a
if cscope is enabled u can use SHIFT+5 ,

Caution : before going to use this make some comment and in comment
add { or }

for(somecode)
{

code
/*

some code
} <--this is commented

*/
code
}

now try to match the { after for.

this is d point required in mind while you are debugging complex code.
--raxit

Nov 7 '06 #3

P: n/a
"2005" <uw*****@yahoo.comwrote:
How do I match the "{" with "}"
This is to math the loop begin and end.
You use strcspn() or strbrk() to find the '{'s and '}'s, and you use a
stack construct (either indirectly, through recursion, or directly,
using, say, a linked list) to determine which '}' belongs to which '{'.
If you want to know how, the simplest way of figuring out an algorithm
is, as so often, to sit down behind a piece of paper, copy down a random
formula with such brackets in it, and observe how you yourself match
them up.
There is a command/short cut (say ALT F5)
ISO C does not guarantee that you even have Alt or F5 keys, let alone
that you can read them.

Richard
Nov 7 '06 #4

P: n/a
"2005" <uw*****@yahoo.comwrites:
How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.
You're asking about some specific editor (and you haven't told us
which one), not about the C language.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 7 '06 #5

P: n/a

Keith Thompson wrote:
"2005" <uw*****@yahoo.comwrites:
How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.

You're asking about some specific editor (and you haven't told us
which one), not about the C language.
Sorry, Visual Studio 6 EE.

Nov 7 '06 #6

P: n/a
In article <11********************@h48g2000cwc.googlegroups.c om>,
2005 <uw*****@yahoo.comwrote:
>
Keith Thompson wrote:
>"2005" <uw*****@yahoo.comwrites:
How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.

You're asking about some specific editor (and you haven't told us
which one), not about the C language.

Sorry, Visual Studio 6 EE.
Smackin' the newbies, day after day.

Nov 7 '06 #7

P: n/a
"2005" <uw*****@yahoo.comwrites:
Keith Thompson wrote:
>"2005" <uw*****@yahoo.comwrites:
How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.

You're asking about some specific editor (and you haven't told us
which one), not about the C language.

Sorry, Visual Studio 6 EE.
Ok, so you'll need to ask in a forum where they discuss Visual Studio
6 EE.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 7 '06 #8

P: n/a
2005 wrote:
Keith Thompson wrote:
>"2005" <uw*****@yahoo.comwrites:
>>How do I match the "{" with "}"
This is to math the loop begin and end.

There is a command/short cut (say ALT F5) I used but I forgot.

You're asking about some specific editor (and you haven't told us
which one), not about the C language.

Sorry, Visual Studio 6 EE.
It's still not about the portable standard C language, which is the
subject of this newsgroup, and thus is off-topic here. You want a
group with the words Visual or Microsoft in its name.

The moment you have to be specific about a compiler, editor,
linker, etc. it is off topic here.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
Nov 7 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.