Static Declarations

From: AnandRaj (anandrm_at_gmail.com)
Date: 08/19/04

  • Next message: Joona I Palaste: "Re: Static Declarations"
    Date: 19 Aug 2004 00:21:07 -0700
    
    

    Hi guys,
    I have a few doubts in C.
    1. Why static declartions are not allowed inside structs?
    eg
     struct a {
    static int i;
    };

    Throws an error ..

    2.How does the complier diffrenciate between a Global Variable and
    Static Variable as both of them will be in the same stack?

    Any pointers wud be helpful!
    Is there any book or site which gives details abt how the memory is handled for
    diffrent variables?

    TIA
    Anand


  • Next message: Joona I Palaste: "Re: Static Declarations"