answersLogoWhite

0


Best Answer

It probably refers to "scope" (see http://en.wikipedia.org/wiki/Scope_(programming)). In programming languages with lexical scope, variables declared in an outer scope can be used in an inner scope, but variables declared in an inner scope cannot be used in outer scopes. It is considered best practice to declare variables (and constants, which are just variables that don't change) at the innermost scope possible for several reasons:

# It makes it most clear what the scope of use is of the variable. # It makes it impossible to mistakenly use it in some other location. # It makes it easier to keep track of what variables exist at any given point in the code. For example, in standard C, nested functions are not allowed. This means that in any function, only two types of variables exist - global variables, and variables declared within that function. This has the advantage of making it easy to understand what any variable refers to.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is meant by delare or initialize a variable or constant at a lowest possible level?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What do you mean by default arguments. How do you delare them?

Gand mrao


What is pointer overloading?

Pointer overloading is another name for polymorphism. You declare a class virtual and then derive some classes from it. You delare a pointer to the base class and, at run time, assign a value to that pointer that refers to any of the classes in the derivation hierarchy. Deferencing that pointer, then, will properly choose the correct method based on which type of class was used, at run time. This works because each class type that is virtual contains a static v-table of methods that is used to choose the actual method to use at run time.


Related questions

Who has the power to delare war?

Congress


What do you mean by default arguments. How do you delare them?

Gand mrao


Who can delare war?

The Congress of the United States and the President too.


Who was the us president who delare November 11 a holiday?

eisenhower


Did the US delare war on Vietnam?

Last declared US war was WWII.


Who did the US delare indepence from on July 4 1776?

a. the bill of rights b. the decloration of indenpendence c. the u.s constituation d. the monroe doctrine


What is the power of the supreme court to declare law or government action unconstitutional?

The US Supreme Court's ability to declare an Act of Congress unconstitutional arises from the implied power of judicial review.


What actors and actresses appeared in Socovetous - 2011?

The cast of Socovetous - 2011 includes: Giordona Aviv as Karen Warren Bub as Malcolm Brendan Burt as Hixby Alexandra Delare as Cindy Kevin Eugene Davis as Lamont Nicole Kontolefa as Sarah Tafari Lawton as George Silvano Mastrangelo as Ken Bianca Tejada as Lisa Jacob Troy as Paul


Why did Canada delare war on gemany?

They declared war on Japan, Italy and Germany, the axis powers. They were able to declare war themselves rather than be dragged into war with the UK commonwealth. They sure did not like what was happening either. Unfortunately, they were in the same boat as the US. They were just getting over the Great Depression. They had a small military force and not a lot of military equipment. They had to do the same as the US. Build up everything.


How many votes from Congress does it take to declare war?

The president is allowed to comit up to 100,000 troops at any given time to anywhere in the world without congressional approval. I do believe that you are asking about the war in Iraq and to answer he had congressional approval when the united states kicked off OIF1.


What is pointer overloading?

Pointer overloading is another name for polymorphism. You declare a class virtual and then derive some classes from it. You delare a pointer to the base class and, at run time, assign a value to that pointer that refers to any of the classes in the derivation hierarchy. Deferencing that pointer, then, will properly choose the correct method based on which type of class was used, at run time. This works because each class type that is virtual contains a static v-table of methods that is used to choose the actual method to use at run time.