[Courses] [C] Beginner's Lesson 4B: Arrays, Qualifiers, and Reading Numbers

Eugene Teo eugene.teo at eugeneteo.net
Sat Oct 12 06:15:04 EST 2002


You are very right. In fact, C _only_ allows variables to be declared
at the beginning of every {} block before any statements begin.

I told myself never ever post anything when I am sleepy :-P

<quote who="Jenn Vesperman">
u> On Sat, 2002-10-12 at 03:32, Eugene Teo wrote:
u> > u> C allows variables to be initialized in the declaration statement.
u> > 
u> > Note that 
u> > C _only_ allow variables to be declared at the beginning of the 
u> > function.
u> 
u> News to me.
u> 
u> Yes, it's -tradition- to declare your variables at the beginning of the
u> function, but it's possible to declare them at the start of any block:
u> 
u> #include <stdio.h>
u> 
u> int main() {
u> 
u>         printf("%s","Hello World\n");
u>         {
u>           int i = 5;
u>           printf("%d\n", i);
u>         }
u> 
u> }
u> 
u> 
u> 
u> Jenn V.
u> -- 
u>     "Do you ever wonder if there's a whole section of geek culture 
u>         	you miss out on by being a geek?" - Dancer.
u> 
u> jenn at anthill.echidna.id.au     http://anthill.echidna.id.au/~jenn/
u> 
u> 
u> _______________________________________________
u> Courses mailing list
u> Courses at linuxchix.org
u> http://mailman.linuxchix.org/mailman/listinfo/courses

-- 
eMail: eugeneteo at eugeneteo.net, eugeneteo at null.cc.uic.edu
gpg pub_key: http://null.cc.uic.edu/~eugeneteo/eugeneteo.asc
main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}




More information about the Courses mailing list