Interview Questions on C - Storage

1. What are all types of Storage Classes exist in C language?

1. Auto 
2. Register 
3. Static 
4. Extern 

2. What is the Default Storage class?


3. What is use of Register Storage class?

The register will be for variables that require quick access. Ex :- counters.

4. What is use of static variable?

Static variable initialized only once and only one copy maintained during the execution of the program.

5. How to declare a global variable?

By using keyword ‘extern’.

6. Can auto and register be use for global variables?

No, They are only for local.

7. Can static be use for global variables?

Yes, global variables can be static.