About 1,490,000 results
Open links in new tab
  1. What is the difference between static local variables and ...

    Local static variables are initialized on first call to function where they are declared. The global ones are initialized at some point in time before the call to main function, if you have few global static variables …

  2. Difference between Local Variable and Global variable

    Mar 21, 2024 · Local variables are declared within a specific block of code, such as a function or method, and have limited scope and lifetime, existing only within that block. Global variables, on the …

  3. Local, Global and Static Variables in C - codequoi

    Jun 17, 2022 · Local, global and static variables all have different lifespans and scopes. So what are the subtle differences between them?

  4. Difference between Local, Global, Extern, and Static ...

    Nov 21, 2025 · Difference between Local, Global, Extern, and Static Variables in C alokm014 When programming in the C language, variables play a pivotal role in storing and managing data. They …

  5. Java Day 5: Local & Global Variables, Static vs Non-Static ...

    Apr 1, 2025 · This blog covers all aspects of Java local/global variables, static vs non-static elements, naming rules, comments, constructors, methods, and object creation in depth.

  6. Global Variables, extern, static, const

    A static variable can be either a global or local variable. Both are created by preceding the variable declaration with the keyword static. A local static variable is a variable that can maintain its value …

  7. When to use static keyword before global variables?

    Question was: "Can someone explain when you're supposed to use the static keyword before global variables or constants defined in header files?" Since OP seems to be beginner, I simply gave the …

  8. Static Variables in C - GeeksforGeeks

    Jul 23, 2025 · Interesting Facts Following are some interesting facts about static variables: Static variables (like global variables) are initialized as 0 if not initialized explicitly. See this for more details. …