How much memory does a static variable takes?
Memory allocated to static variable is not depends on static keyword. only depends on data type.So, it is called an static specifier.It only occupies the values of int,char,float etc.static keyword does not required any memory. example: static int p; static char q; static float r; static short int s; printf(" %d %d %d %d ", sizeof(p), sizeof(q), sizeof(r), sizeof(s)); o/p: 4 1 4 2 (In case of 32 bit compiler) In case of Dos static occupies 2 bytes for integer.