Whenever we declare a variable in our program there comes an idea of a variable's visibility. Then we think about what will be its initial value? In c every variable have its storage class. Four types of storage classes in c: Automatic Static Extern Register Automatic storage class( variable) : Automatic variable's visibility can be within block of local function. And it will be stored in stack segment. All local variables resides in stack segment and belongs to automatic storage class. Initial value of automatic variable will be garbage. Static storage class(variable) : Static variable will be visible within block of local function or within block of function. It will be stored in data segment. All static variables resides in data segment block. Initial value of static variable will be 0. And keeps updated value. Extern storage class(variable) : Extern variable used to link a variable within multiple files. Scope or visibility of extern variable is globally. It is also stor...
This blog will become interesting and convincing those who want to come out from their comfort zones and want to do something different . Welcome to my blog .