As we know that address of the variable declared with register storage class can't be taken. So i tried to create an array with register keyword and tried to access the element . but i noticed that there is no any error raised by compiler.
#include <stdio.h>
void main()
{
register int x[]={3,4};
printf("%d\n",x[0]); // compiled successfully
// printf("%d",&x[0]);// compiler raises an error
}
as we all know that compiler converts the expression x[0] to *(x+0) where x represents the base address. But how is it possible to get the base address of the array since it is declaraed with register storage class?
Thanks in Advance..