answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between a global variable and a private 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.


Analyze the difference among local module-level and global variables and explain how ActiveX DLLs are created?

Local Variable A Local variable is a variable whose scope is limited to the Block of the Subroutine defining it. Private Sub Command1_Click Dim a as integer End Sub Module Level Variable A Module Level variable is a variable whose scope is limited to the Form Module defining it. Public Sub Command1_Click Dim a as integer End Sub Global Level Variable A Global Level variable is a variable whose scope can be limited to the entire project defining it. Private Sub Class_Initialize () Dim a As Integer End Sub


Difference between global and transnational strategy?

the difference between global and international strategy


Describe the differences between local and module-level variables?

local Variable A Local variable is a variable whose scope is limited to the Block of the Subroutine defining it. Private Sub Command1_Click Dim a as integer End Sub Module Level Variable A Module Level variable is a variable whose scope is limited to the Form Module defining it. Public Sub Command1_Click Dim a as integer End Sub Global Level Variable A Global Level variable is a variable whose scope can be limited to the entire project defining it. Private Sub Classjnitialize () Dim a As Integer End Sub


Difference between international and global communication?

what is the difference between international communication and global communication


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 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.


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