Re: [algogeeks] Re: difference b/w static global variables and global variables

2012-02-29 Thread Mad Coder
then how static can be an extern? Extern means that this variable can be used in other files also, whereas static means this variable is initialized only once and its scope is static with respect to its scope which can be either a function or file. So we cant declare a variable static and extern

[algogeeks] Re: difference b/w static global variables and global variables

2012-02-27 Thread Don
In addition to the difference in scope, the standard requires that static variables be initialized to zero by default. Global variables are not required to be initialized by default. Don On Feb 25, 10:51 am, AMAN AGARWAL mnnit.a...@gmail.com wrote: Hi , Is there any difference b/w static

Re: [algogeeks] Re: difference b/w static global variables and global variables

2012-02-27 Thread teja bala
As we all know about data organisation structure in c like stack area,heap area and un intialized data segment so wen uninitialized global variable will be allocated memory in unitialized data segment but static variable ll be local to entire file,initialized to 0 and kept in heap area

Re: [algogeeks] Re: difference b/w static global variables and global variables

2012-02-27 Thread Ashish Goel
then how static can be an extern? Best Regards Ashish Goel Think positive and find fuel in failure +919985813081 +919966006652 On Mon, Feb 27, 2012 at 10:50 PM, teja bala pawanjalsa.t...@gmail.comwrote: As we all know about data organisation structure in c like stack area,heap area and un