Storage class of all variables are auto by default unless we specify a variable is register or static or extern in C program.
Both auto variable and register variable are local variables. Register variables are stored in register memory. Whereas, auto variables are stored in main CPU memory.
Register variables will be accessed very faster than the normal/auto variables since they are stored in register memory rather than main memory.
But, only limited variables can be used as register since register size is very low. (16 bits, 32 bits or 64 bits)
Storage class of all variables are auto by default unless we specify a variable is register or static or extern in C program.
- Both auto variable and register variable are local variables. Register variables are stored in register memory. Whereas, auto variables are stored in main CPU memory.
- Register variables will be accessed very faster than the normal/auto variables since they are stored in register memory rather than main memory.
- But, only limited variables can be used as register since register size is very low. (16 bits, 32 bits or 64 bits)
need an explanation for this answer? contact us directly to get an explanation for this answer