On Friday 09 July 2010 01:20:49 RIDER wrote:
> if c is procedural language then why declaring variable any where
> works by gcc compiler?

By default GCC uses a relaxed set of rules when compiling C code. Try this:

$ gcc -pedantic -Werror source.c
source.c:XX: error: ISO C90 forbids mixed declarations and code

> according to procedural property declaration
> should only be at top ?
> 
>  void main(){
>          int c=1;
>          printf("%d",c);
>          int d=5;
>          printf("%d",d);
> 
>          return;
>          }
> why this work in c?

-- 
Mihai Donțu

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to