1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Static variable and global variable

Discussion in 'C' started by prem_may10, Oct 28, 2006.

  1. prem_may10

    prem_may10 New Member

    Joined:
    Sep 28, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Hi,
    what is static variable, globale variable?

    what is the difference between static variable & globale variable


    Thanks
    yasodhar premchand
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,283
    Likes Received:
    364
    Trophy Points:
    83
    Try giving a better heading to your queries so that it helps others to search as well as experts can understand it while seeing the title. I have edited the title for this thread.

    Static Variable

    A variable that exists in only one location and is globally accessible by all instances of a class and also a variable for which memory remains allocated as long as the program executes.

    Global Variable

    A variable that can be accessed by all parts of a program so it does not belong to any subroutine in particular and can therefore can be accessed from any context in a program
     

Share This Page