1.

Explain the difference between the local variable and global variable in C?

Answer»
S.noLocal VariableGlobal Variable
1.Declared INSIDE functionDeclared outside function
2.Accessed only by STATEMENTS that are inside a function where they are declaredAccessed by any statement THROUGHOUT the program
3.Created when ENTERING function block and gets destroyed when exits.Stays in existence throughout the when the application is executing
4.It is stored on the stack.Stored in a fixed location.


Discussion

No Comment Found