Giving register prefix for a variable is only a request u r making to the compiler to be stored in registers but whether to store the variable in the CPU registers depends on the availability of these regs


On Fri, 17 Dec 2004 Uma D wrote :
>Hi,
>How is this possible? (I am using Borland C.)
>
>void main()
>{
>      register char c='a';
>      char *i;
>      i = &c;
>      printf("%d", *i);
>}
>Output: a
>
>Register variables are stored in CPU registers, and so they must not be present in memory, right? And as they are not in memory, the o/p of the above program should not be 'a'.
>
>But in this code, I am able to access the register variable, in such a way, that, they are stored in memory. What is happening here, aren't they actually stored in registers?
>
>With thanks,
>Uma
>
>
>---------------------------------
>Do you Yahoo!?
>  Yahoo! Mail - Easier than ever with enhanced search. Learn more.





To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=663069627


Yahoo! Groups Links

Reply via email to