Results 1 to 4 of 4

Thread: static, global, local variable & volatile....

  1. #1
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Question static, global, local variable & volatile....

    where are static, global, local variables stored in memory..... and how is volatile different from these.......


  2. #2
    Expert Member
    Join Date
    Dec 2007
    Answers
    138

    Re: static, global, local variable & volatile....

    All local variables are stored in the stack frame of the Sub/Function in which they are defined. Therefore, the address of local variables may vary with each invocation of the Sub/Function in which they are defined (because they are created each time the Sub/Function is executed, and destroyed upon exit). It is unsafe to return a pointer to a local variable, since the storage for that variable is released when the Sub/Function ends.

    Conversely, GLOBAL and STATIC variables are stored in the main data memory area, so their address stays constant for the duration of the program module, so returning a pointer to a GLOBAL or STATIC variable is quite safe.


  3. #3
    Junior Member
    Join Date
    Jun 2008
    Answers
    1

    Re: static, global, local variable & volatile....

    In case of volatile variable ,memory addresses are always available in chache memory hence when we need fast execution of some variable , Volatile variable is very usefull .


  4. #4
    Junior Member
    Join Date
    May 2008
    Answers
    3

    Re: static, global, local variable & volatile....

    what is the difference between java and javascript?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact