answersLogoWhite

0


Best Answer

1. Local variables cannot be used by other forms.

2. Cannot be used globally.

3. They can slowdown the compiling process.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

A local variable only has meaning within the function block it was declared in. This means that you don't have to have a separate variable name for each local variable in your program, and you can guarantee that they will not be modified outside of the function they are in.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Local variables are scoped to the locality in which they are declared. That is, they are not accessible outwith that scope because they do not physically exist until that scope becomes active. Thus when invoking a function, its local variables are instantiated. When the function returns to its caller, the local variables fall from scope and are destroyed. Similarly with non-static class members; the members are instantiated when an object of the class is instantiated and destroyed when the object falls from scope.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

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.

This answer is:
User Avatar

Add your answer:

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

What are variables in programming?

In computer programming, variables refer to a particular location in the memory that holds a value. Variables are equivalent to their assigned values.


Why there are not local and global controls in visual basic programming?

There are, you can either use "Dim" or "Public" when declaring variables to allow them to be used either in the local Sub or throughout the whole program.


What type of linear programming can be found by graphical methods?

A linear programming question with two variables. Problems with three can be solved if there is a constraint that reduces them to effectively two variables. Linear programming with 3 variables, using 3-d graphs is possible but not recommended.


Advantages of computer programming?

The advantages of computer programming is that it pays well since programming is a creative task. Computer programming helps human beings solve problems on a regular basis.


How are constants and variables important in devoloping java programs?

Without variables, you won't be able to do much programming. Variables is where you store data; such data may change over time. And computer programming is all about manipulating data.


What are the advantages of nano programming?

nothing


You need to understand a subroutine's in order to use it?

You need to understand a subroutine's ____ in order to use it. a. internal structure b. local variables c. programming style d. interface


Why do you need to keep variables the same?

In programming, variables change all the time. In scientific testing you control variables to determine what other changes occur.


What are advantages of programming languages?

it is eco friendly


What are the unique advantages of an object programming?

asdfasdf


What are five advantages of global variables?

S


How do I figure out the programming decision and variables for anything?

There is no programming solution for "anything". Programs are specifically designed to solve a particular problem.