What are local and global variables?
Answers were Sorted based on User's Feedback
Answer / udayakumar
local variables are the variables which are declared with in
a function and the scope of that variables are only within
that function.Global variables are the variables which are
declared globally.Since it is declared globally it can
accessible to all the functions inside the program...
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ashish
Local:-
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:-
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.
| Is This Answer Correct ? | 2 Yes | 0 No |
local variable:-its uses inside the function that is these variable exist inside the function and other fu no access out side the main function.
while global variables are variables and which are declared both sides of function inside and outside that is globally.all functions can access out of main function.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the scope of static variable in c?
difference between Low, Middle, High Level languages in c ?
what is the different between if-else and switch statment (other than syntax)
26 Answers CTS, Oracle, Scorpos,
I need previous papers of CSC.......plz help out by posting them.......
what will be maximum number of comparisons when number of elements are given?
code for reverse alternate words from astring
what is c
How can I insert or delete a line (or record) in the middle of a file?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Can we increase size of array in c?
we all know about the function overloading concept used in C++ and we all learnt abt that.... but that concept is already came in C in a very smaller propotion ... my question is IN WHICH CONCEPT THERE IS A USE OF FUNCTION OVERLOADING IS USED in C language?????????????
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference