Aakash Repeater Courses
ApplyTake Aakash iACST and get instant scholarship on coaching programs.
The C language was developed by Dennis Ritchie who worked at AT&T laboratories in the early 1970s. It is a middle-level language that is used for writing application services, compilers, and much more. It forms the basis of almost all the programming languages written in a systematic and structured order. It is well-defined, and the programme is broken into parts or functions so it is easier for the programmer to understand and write.
In the C programming language, we write various programmes for which we often have to define and declare variables and their data types. The storage class is used to describe the features of a variable. The scope within which the variable will store its value, the lifetime of the variable, and the default value of variables are all dependent on the type of storage class. There are four types of storage classes, which are described below.
This is the default class of the variables. Whenever the class is not declared, it is set to auto; hence, the name "autored'', it is set to auto; hence, the name "auto." It can be called and used only within the block in which it is declared, and access is destroyed outside the block. By default, it returns a garbage value.
It is also known as an external storage class because the scope of the variable is global, i.e., it can be used throughout the program. The keyword "extern" is used to declare the class. Its default value is set to 0.
As the word Static means constant the value of this variable will not change and remain static even when it is redeclared or tried to change in the block. However, it is visible only in the declared file. Its initial value is 0. The keyword used to declare this class is "static." This can further be classified as a local static variable or a global static variable. If the type is local then it can be called only inside the block. If the type is global, it can be accessed anywhere inside the program.
The keyword used to declare this is "register." Its scope is only within the block, and it sets the initial value as garbage. This is used where we expect quick results. The faster output is obtained because the CPU registers its value instead of storing it in RAM. Rest all of the classes and allocate RAM memory.
Storage Class | Memory | Default Value | Scope | Lifetime |
Auto | RAM | Garbage | Within the Block Only | Only till the block is active |
Extern | RAM | 0 | Anywhere In the Program | Till the end of program |
Static | RAM | 0 | As per Declaration | Till the end of program |
Register | Register | Garbage | Within the Block | Only till the block is active |
The C language is also known as the mother of all languages.
The UNIX system, Adobe Photoshop, Google, and MySQL are a few real-world applications of C.
The auto class is also called the automatic storage class.
C++ can be called an advanced level of the C language, but both are different.
The storage classes define the lifetime and scope of variables, whereas memory allocation is used to allocate space in the memory block.
Take Aakash iACST and get instant scholarship on coaching programs.
This ebook serves as a valuable study guide for NEET 2025 exam.
This e-book offers NEET PYQ and serves as an indispensable NEET study material.
As per latest syllabus. Physics formulas, equations, & laws of class 11 & 12th chapters
As per latest syllabus. Chemistry formulas, equations, & laws of class 11 & 12th chapters
As per latest 2024 syllabus. Study 40% syllabus and score upto 100% marks in JEE