Thread: static global & global variables

  1. #1
    Registered User
    Join Date
    Sep 2009
    Location
    pakistan
    Posts
    3

    Question static global & global variables

    I studied about satic global and global variables but still confused so plz help me to understand this topic and i'll realy appreciate if you can giva any code as example ...........!

  2. #2
    Registered User
    Join Date
    Aug 2009
    Posts
    5
    A program can be spread across two or more files.So, a global variable can be accessed by all the files whereas, a static global variable can be accessed only by the file in which it is declared.Static means permanent and hence the value in static global variable is shared by
    all the functions in that file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. uploading file to http server via multipart form data
    By Dynamo in forum C++ Programming
    Replies: 1
    Last Post: 09-03-2008, 04:36 AM
  2. Question about Static variables and functions.
    By RealityFusion in forum C++ Programming
    Replies: 2
    Last Post: 10-14-2005, 02:31 PM
  3. Global variables used in a linked class, getting errors.
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 09-24-2005, 12:25 AM
  4. Replies: 2
    Last Post: 10-02-2004, 10:12 AM
  5. Static global variable acting as global variable?
    By Visu in forum C Programming
    Replies: 2
    Last Post: 07-20-2004, 08:46 AM