July 08, 2022 |44.9K Views

    Storage classes

      Share  1 Like
    Description
    Discussion

    Storage Classes are used to describe the features of a variable/function. These features basically include the scope, visibility and life-time which help us to trace the existence of a particular variable during the runtime of a program.


    C language uses 4 storage classes,

    auto: This is the default storage class for all the variables declared inside a function or a block. Hence, the keyword auto is rarely used while writing programs in C language.

    extern: Extern storage class simply tells us that the variable is defined elsewhere and not within the same block where it is used. Basically, the value is assigned to it in a different block and this can be overwritten/changed in a different block as well. 


    Storage classes : https://www.geeksforgeeks.org/storage-classes-in-c/