Presentation is loading. Please wait.

Presentation is loading. Please wait.

Local Variables, Global Variables and Variable Scope

Similar presentations


Presentation on theme: "Local Variables, Global Variables and Variable Scope"— Presentation transcript:

1 Local Variables, Global Variables and Variable Scope
$p!derLabWeb C Programming Lecture-10 Local Variables, Global Variables and Variable Scope

2 Local Variables The variables which are declared inside the function or in a block is called the local variables. Its scope is inside that block or function. Which means that they can’t be accessed outside that block or function. When these are declared and not initialized with some value then these are initialized with the garbage values.

3 Global Variables These are the variables whose scope is all over the program. Which means we can access them any where in the program. When these are declared and not initialized with some value then these are initialized with the default values.

4 Default Values Table Datatype Default Values int float char ‘\0’
float char ‘\0’ double Pointer NULL

5 Thank you!


Download ppt "Local Variables, Global Variables and Variable Scope"

Similar presentations


Ads by Google