Thread: what is difference between global variable and static variable in the context of life

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    90

    what is difference between global variable and static variable in the context of life

    I am not clear about the life time of global variable and static variable I think both initialize only once and stay alive for life time of program

    what is difference between global variable and static variable in the context of life time

    Edit : static may be local or global. What is difference between local static and global static variable. I think the difference is only with the scope not in life time
    Last edited by Player777; 04-13-2020 at 12:40 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. static global variable and static extern global variable
    By gunjansethi in forum C Programming
    Replies: 8
    Last Post: 01-12-2011, 01:00 AM
  2. Replies: 8
    Last Post: 09-27-2010, 04:11 PM
  3. Static Local Variable vs. Global Variable
    By arpsmack in forum C Programming
    Replies: 7
    Last Post: 08-21-2008, 03:35 AM
  4. static class variable vs. global variable
    By nadamson6 in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2005, 03:31 PM
  5. Static global variable acting as global variable?
    By Visu in forum C Programming
    Replies: 2
    Last Post: 07-20-2004, 08:46 AM

Tags for this Thread