answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is a global variable a non-local variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

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.


How can you declare global and local variable in pseudocode?

A local variable is a variable declared inside a construct, such as a class or function, while a global variable is a variable declared outside of any construct.


Why static variables in a function have global extent?

A variable declared static outside of a function has a scope the of the source file only. It is not a global variable. A variable declared outside of a function and without the static qualifier would be a global variable.


How do you access global variable from within the main function when the local variable is of the same name?

When you acess a global variable inside main function you must use the same name, because the variable declared as global can be accessed by any function/procedure on the class where it was defined.


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.


Where global variable get register?

const


What is the syntax of global variable in java?

There's no global variables in Java.


How are global variable different from local variable in Visual BASIC?

A global variable is available for use throughout the program. It is normally declared outside any procedure. A local variable is only available for use in the procedure it was declared in. Most variables are local, but there will be occasions when you want different procedures to be able to use the same variable. This is when you use a global variable.


What is Global variables in vb6?

Global variables are accessible through your project. Different classes, modules, and interfaces can access a variable if it is global. A Global Variable can simply be declared by putting the word Public in front of the variable. Here is an example. Public V As String Now anything in your whole entire project can access the variable V.


If the variable flag can only be declared once in the program it was declared as what type of variable?

It's a global variable.


What is a local variable and What statements are able to access a local variable?

A local variable is a variable that can only be called on by the module. Where as a global variable can be called upon by any module. Only statements made inside the same module can call on a local variable.


What is the other name of global variables?

Another name of global variable is "EXTERNAL VARIABLES".