answersLogoWhite

0

There are two ways to declare varibles.

1. Locally

2. Globally When you declare a variable locally in any function that means it is only accessible by that function. When you declare a variable globally so it is accessible by all the functions in the program. Declaring variables with static keyword means you are setting its value null.

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

What is the difference between a global variable and a private variable?

The accessibility. The global one: almost everywhere in the code may reference to the global variable directly. The private variable, is private to the declaring module (class, method, assembly) only. Outside of that module has no access to it directly.


What is the difference between a static variable a global variable and a local variable?

A static variable is a variable allocated in static storage. A local variable is a variable declared inside a function. A global variable is a variable declared outside of any class or function. Note that local variables and global variables can both be allocated in static storage.


Difference between global and transnational strategy?

the difference between global and international strategy


Difference between international and global communication?

what is the difference between international communication and global communication


Member modifier 'public' must precede member type and name means in computer C language?

While you declaring the global variable you should declare it correctly... This problem mostly arise because any one of the data type in global should not have variable.


What is difference between Static and Global variable?

Static may be local of global -local static variable is limited to the function scope. and retain it's value when function is been called . compiler differentiate static variables with a prefix function name while dealing with same name static variable in different functions. - Global static variable is visible to all the function defined in the file and retain it value but it cannot be used outside this file. now Global Variable --- this variable is also visible to all of the functions inside the file but also can be used outside the file via extern keyword.


Is a global variable a non-local variable?

True, a variable cannot be both global and local. But if a global and a local variable share the same name, the local one will hide the global.


What is the difference between global variable and extern variable?

Global variables are non-local variables. That is, variables that are not defined in a function or class. They are globally accessible to all code in the same translation unit. External variables are global variables that have external linkage; they are accessible across translation units.


Difference between global optimization and partial optimization?

essential diffrence between global and local optimization


What is the difference between global depletion of ozone and the hole in the ozone layer?

There is no difference between the two. The global depletion of ozone is the hole over ozone only.


What is the difference between static function and global static function?

'global static'?! There is no such thing.


Is there a difference between international politics and world politics?

what is the difference between global politics and international politics