Follow us on: facebook twitter linkedin

PROGRAMING

Storage class in C

Post by : John Deo
Post date: 2023-12-01 16:16:19

Read time : 5 minute
Total views: 255 times
hero-img

Storage class in C

Every variable has two properties

  1. Datatype.
  2. Storage class.

Storage class mean variable scope lifetime and visibility. There are four types of storage class:

  1. Automatic
  2. External
  3. Static
  4. Register

Automatic

A variable has declared inside a block count as local or automatic variable. For example

External

Variable has declared outside of the main and others user define function, that all are count as external variable.

Register

Register variable always declare by register keyword. They are known bit faster than automatic variable for modern compiler.

Static

A static variable is declared by using the static keyword. During the program execution time static variable will initialized only first time.

Share by:

Keep exploring

Read what excites, achieves and moves us Read what excites, achieves and moves us