Afficher un message
Vieux 17/10/2007, 10h33   #4
CBFalconer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Identifying variables: what process do you follow?

jaysome wrote:
> Justin Spahr-Summers <Justin.SpahrSummers@gmail.com> wrote:
>

.... snip ...
>
>> The scope of the variable 'b' begins at the inner opening brace
>> and ends at the inner closing brace, and as long as you keep its
>> declaration at the very beginning of that scope, it's legal in
>> both C90 and C99. Any amount of nested braces is allowed as well.

>
> If the scope of the variable 'b' begins at the inner opening
> brace, shouldn't I be allowed to do something like this?
>
> int myfunction (void) {
> int a = 5;
> /* do stuff with 'a' here */
> {
> int b0 = b;
> int b = 6;


It _can_ begin at the brace. It does begin when b is declared.

--
Please do not top-post. Your answer belongs after (or intermixed
with) the quoted material to which you reply, after snipping all
irrelevant material. See the following links:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/> (taming google)
<http://members.fortunecity.com/nnqweb/> (newusers)



--
Posted via a free Usenet account from http://www.teranews.com

  Réponse avec citation
 
Page generated in 0,06413 seconds with 9 queries