ankitweblogic logo
W e b t u t o r i a l s

Programing Approach

Algorithm

Flow Chart

Define C

Define Programming

C - Syntax

C - Variables

C - Keywords

C - Data Types

C - Comments

Turbo C - Shortcut keys

C - Operators

Hierarchy of Operators

Ex: Arithmetic Operator

Constant Variable

C - Escape Sequence

Control Structure - if

Ex: If condition

Ex: Inc / Dec Operator

C - loops

Ex: Loops

C - Nesting Of loops

Ex: Nested Loops

Jumping Statements

C - Arrays 1D

C - Arrays 2D

C - Sorting

ASCII Value

Character I/O Function

C - Strings

Ex: Strings

Array of Strings

C - Math Functions

User-defined Function

Exercise Function

C - Types of Functions

Storage Class

C - Header Files

C - Preprocessor

C - Pointers

C - Structures

C - Typedef

C - File Handling

Ex: File Handling

Command Line Argument

MCQ

Storage classes in c

To define a variable we need to mention not only its data type but also its storage class. Storage classes will tell the compiler, where the variable is stored and what will be its default value. In C, there are 4 different types of storage classes.

1. Automatic: The auto storage class is the default storage class for all local variables.
2. Register: The register storage class is used to define local variables to be stored in a register instead of RAM.
3. Static: The static storage class instructs the compiler to keep a local variable in existence during the life-time of the program. Therefore, making local variables static allows to maintain their values between function calls.
4. External: The extern storage class is used to give a reference of a global variable that is visible to ALL the program files.


Difference Between Automatic, Register, Static, External
S.No. Feature's Automatic Register Static External
1. Storage Ram CPU Ram Ram
2. Default value Garbage value Garbage value 0 0
3. Scope Local Local Local Global
4. Keyword auto register static extern

Uses register storage class very often because there are very few CPU registers and many of them might be busy.

Updated: 24-Nov-18