Re: C [variable scope]

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 12/23/04


Date: Thu, 23 Dec 2004 19:03:20 GMT


"Keith R" <keith@nospam> wrote in message
news:Za6dnUNsNrSmjlbcRVnyhg@pipex.net...
> Hello NG
>
> C Language
>
> ...in a scope
> {
> for ( int i=0;i<someValue;++i){
> /* */
> }
>
> for ( int i=0;i<someValue;++i){
> /* */
> }
>
> }
>
> Is my second declaration of i legal?

For C90, neither is legal. For C99, both are.

> Also what is the current C Standard document?

ISO 9899:1999 see www.webstore.ansi.org to get your own copy.

-Mike



Relevant Pages

  • Re: Storgae durations
    ... but I've never seen anyone use a C99 ... implementations of C90. ... So the evidence is against you. ... But it isn't the only C compiler on Windows. ...
    (comp.lang.c)
  • Re: Implicit int
    ... implicit int was one of the few benefits C99 brought). ... either a tightening up of the C90 specs, or addition of requested, ... E - the long long int type and library functions ...
    (comp.std.c)
  • Re: Why oh why does this NOT give a compile error?
    ... I guess a lot depends on if the compiler will still accept K&R style code ... A conforming implementation of C99 is required to accept functions without ... that compilers often retained them because they were valid in C90). ... be viewed as, effectively, different languages. ...
    (comp.lang.c)
  • Re: Is C99 C?
    ... free applications in C90 and C99. ... C is no more a single language than English or even French. ... I write code TODAY that maps onto a C90 with long long ... freedom of speech was made the First Amendment to the United States ...
    (comp.lang.c)
  • Re: Is C99 C?
    ... It's possible to write bug ... C does not mean C90 or C89 or even C99. ... the 1st amendment prevents the Government from hindering your ...
    (comp.lang.c)