Frequently Asked C Language Interview Question & Answers

Difference between global and static variable?

Static variables persist throughout the scope, but the lifespan is not throughout the program. Global variables persist throughout the scope of base blocks of memory that is their lifespan is throughout the program.