Submitted by: mohit12379
Neither there is a concept of auto static var and Nor a auto extern varibales because auto var are local variable whose lifetime is within a block and located on stack area . Process will automatically assign stack memory when auto (local) variables come into picture and automatically get cleaned from stack memory when goes out of block of function.
NOTE :- extern, static, auto varibles can't be mixed. Another thing is auto variable needs block means they should be declared and use in a block of function.
See Following Code and try at your home. Any goodthing you have pls write
me at mohit.gonduley@gmail.com
********************************************************************************
#include "stdio.h"
#include "stdlib.h"
auto int g_iVal = 90; // It gives a compile time ERROR
int main(void)
{
auto int iVal = 0; // It will WORK
auto static int st_iVal = 10;// It gives a compile time ERROR
return 0;
}
******************************************************************************
Above answer was rated as good by the following members:
wael.salman, yzesong