answersLogoWhite

0

What are local variables advantages?

Updated: 8/20/2019
User Avatar

Wiki User

9y ago

Best Answer

1) Since the data cannot be accessed from other functions, data integrity is preserved. 2) Only required data can be passed to function, thus protecting the remaining data.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are local variables advantages?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are five advantages of global variables?

S


Why can't java compiler initialize local variables?

Its not that the compiler can't initialize local variables; its that the compiler does not initialize local variables.This is by design and language specification. If you want to initialize local variables, you must explicitly do so.


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.


Where auto variables are stored?

Auto variables are stored on the stack alongside all other local variables.


Are C variables initialized to 0 by default?

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


Where does Local Variables get stored in?

Stack.


Local Variables will get stored in?

Stack.


What are the advantages of local variables in programming?

1. Local variables cannot be used by other forms. 2. Cannot be used globally. 3. They can slowdown the compiling process.


What is Advantages of register variables in C?

Faster execution of code.


When variables are declared in the body of a method they are know as what?

Local Variables There are two types of variables based on the location of declaration 1. Instance Variables- Declared inside a class, but outside of any method's body. 2. Local Variables- Declared inside a method's body inside a class.


Where local variables are stored in c?

On the stack.


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(); }