Tuesday, January 5, 2010

Global variable vs Local variable

Today i'm going to explain you about scope of variable. Score of Variable is area of variable exists.

Local Variable:

local variable exists only in certain function. Outside of that function, variable is unknown. Simply local variable is for local.

Eg: function()
{
var declaration
}
Global variable

Global variable is possessed by all function. It's exists in global level of the program. Eg:
var declaration
function();
main()
{
}

0 comments:

Post a Comment