answersLogoWhite

0


Best Answer

Storing global data.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a logical use for global variables?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Which operator is used 2 access ahidden global variables?

To access a hidden global variable, use the scope resolution operator ::


What are the differences between a global variable and macro?

A global variable is a place of data storage which multiple modules of application (sometimes all modules) can access to read and modify the variable's content. A macro is something altogether different. A macro is a set of instructions, typically used to save keystrokes when coding, and to maintain code readability. While macros can reference, declare or use variables (including global variables), macros and variables are quite different and cannot be compared.


Are C variables initialized to 0 by default?

Only global/static variables are, local variables aren't.


whose variables are also known as global variables?

The variables which are declared outside the main() function is known as global variables and they can be used anywhere in the program. And, the variables which used declare inside the main() function is known as local variables and they can be used inside the main() function only. Example: #include<stdio.h> #include<conio.h> int x,y; // global variables void main() { int a,b; // Local variables ------------ ---------------------- --------------------- getch(); }


Is declaration of variables allocated memory?

Constants, static variables and global variables are allocated in the program's data segment at compile time. Local variables are allocated on the stack at runtime. Variables cannot be allocated on the heap, you must use a constant, static variable, global variable or local variable to store the start address of a dynamic memory allocation. The variable must be a raw pointer or a reference handle (a smart pointer).

Related questions

Why there are no global variables in java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:The global variables breaks the referential transparencyGlobal variables creates collisions in namespac


When is better to use global variables rather than utilizing local variables in a program?

In my opinion it is rarely a good idea to use global variables, unless you need to refer to them across modules, or their values need to be keep for a long period of program execution. Local variables should always be used when their lifetime is short, usually only in the module they are declared in. Global variables lifetime will be for the length of the program execution.


What is the other name of global variables?

Another name of global variable is "EXTERNAL VARIABLES".


What are global variable?

Variables that are declared globally outside every program are called global variables.


Which operator is used 2 access ahidden global variables?

To access a hidden global variable, use the scope resolution operator ::


What variables can affect the speed of a runner?

The most logical variables are probably stance and how good you warmup


What are the differences between global variables and local variables in C plus plus?

Global variables can be seen in all blocks of your program, when local variables are visible only within the block where it's declared.


Can global variables be called preprocessors?

No.


Is global variables are stored in registers?

They is not.


What are the disadvantages of variables?

The only disadvantage of a global variable is that you cannot directly encapsulate them. Other than that, there is no real disadvantage of global variables.


What is the syntax of global variable in java?

There's no global variables in Java.


What are the differences between a global variable and macro?

A global variable is a place of data storage which multiple modules of application (sometimes all modules) can access to read and modify the variable's content. A macro is something altogether different. A macro is a set of instructions, typically used to save keystrokes when coding, and to maintain code readability. While macros can reference, declare or use variables (including global variables), macros and variables are quite different and cannot be compared.