answersLogoWhite

0


Best Answer

Local

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Variables declared within a button's click-event are?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Examples of automatic variables in c?

Automatic variables are variables that are declared within the scope of a block, usually a function. They exist only within that scope, i.e. that block, and they cease to exist after the block is exited. These variables are usually allocated from the stack frame.


What is meant by delare or initialize a variable or constant at a lowest possible level?

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.


In most languages where does a local variables scope begin and end?

A local variable only exists within the scope in which it is declared. As soon as the scope ends, the variable ceases to exist. { // beginning of a scope, i does not yet exist int i = 42; // local variable declared, i now exists } // end of scope, i no longer exists


Difference between field and local variable?

Well, hehe its quite simple. You must be a dumb little nerd if you cant find it out. I suggest taking Pre IB computers and eating cherrios for breakfast to clear your mind. Maybe after a hot shower with your rabbit youll be able to brainstorm through the ultimate collage of confusion!


Static variable in c plus plus?

There are two uses for a static variable in C++. When declared outside of a class, a variable is regarded as being global. However a static variable is deemed local to the file in which it is declared. That is, the variable is scoped to the file, and cannot be accessed by code outside of that file. This aspect was inherited from C. C++ also allows static variables to be declared inside a class. In this case, the variable is local to the class. By contrast, instance variables (non-static member variables) are local to each instance of the class. With static variables, there is only one instance of each variable which can be shared by all instances of the class. It is not unlike a global but it is scoped to the class. Since all static variables are instantiated at compile time, they exist for the entire duration a program runs. Even if they fall from scope, they never lose their value. Static variables defined within a class are also available even when no instances of the class are instantiated. Their visibility outside of the class is dependent upon whether they are declared public, protected or private.

Related questions

What are instance variables?

These are normal variables declared within a class that are attached to an object instance of a class.


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.


Examples of automatic variables in c?

Automatic variables are variables that are declared within the scope of a block, usually a function. They exist only within that scope, i.e. that block, and they cease to exist after the block is exited. These variables are usually allocated from the stack frame.


Is it True or False that Variables declared in the particular member function are know as data members and can be used in all member functions of the class?

False. Variables declared within a particular member function are local to that function, and are automatically allocated and deallocated at entry and exit of the function.


Is global variables are declared within the main function?

Might be, but don't forget the keyword 'extern':int main (void){extern int errno;...}


What is meant by a class in java programming?

Class - A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.Classes in Java:A class is a blue print from which individual objects are created.A sample of a class is given below: public class Dog{ String breed; int age; String color; void barking(){ } void hungry(){ } void sleeping(){ } }A class can contain any of the following variable types.Local variables . variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed.Instance variables . Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded. Instance variables can be accessed from inside any method, constructor or blocks of that particular class.Class variables . Class variables are variables declared with in a class, outside any method, with the static keyword.A class can have any number of methods to access the value of various kind of methods. In the above example, barking(), hungry() and sleeping() are variables.


What is meant by delare or initialize a variable or constant at a lowest possible level?

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.


In most languages where does a local variables scope begin and end?

A local variable only exists within the scope in which it is declared. As soon as the scope ends, the variable ceases to exist. { // beginning of a scope, i does not yet exist int i = 42; // local variable declared, i now exists } // end of scope, i no longer exists


Difference between field and local variable?

Well, hehe its quite simple. You must be a dumb little nerd if you cant find it out. I suggest taking Pre IB computers and eating cherrios for breakfast to clear your mind. Maybe after a hot shower with your rabbit youll be able to brainstorm through the ultimate collage of confusion!


What two buttons next to the Help icon are used to minimize and restore the worksheet within the Excel window?

The minimize and restore buttons


Static variable in c plus plus?

There are two uses for a static variable in C++. When declared outside of a class, a variable is regarded as being global. However a static variable is deemed local to the file in which it is declared. That is, the variable is scoped to the file, and cannot be accessed by code outside of that file. This aspect was inherited from C. C++ also allows static variables to be declared inside a class. In this case, the variable is local to the class. By contrast, instance variables (non-static member variables) are local to each instance of the class. With static variables, there is only one instance of each variable which can be shared by all instances of the class. It is not unlike a global but it is scoped to the class. Since all static variables are instantiated at compile time, they exist for the entire duration a program runs. Even if they fall from scope, they never lose their value. Static variables defined within a class are also available even when no instances of the class are instantiated. Their visibility outside of the class is dependent upon whether they are declared public, protected or private.


What are local variables and global variables?

Local variables: These variables only exist inside the specific function that creates them. They are unknown to other functions and to the main program. As such, they are normally implemented using a stack. Local variables cease to exist once the function that created them is completed. They are recreated each time a function is executed or called. Global variables: These variables can be accessed (ie known) by any function comprising the program. They are implemented by associating memory locations with variable names. They do not get recreated if the function is recalled.