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 | |
|
|
Yahoo! Groups Links
- To reply to this message, go to:
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4586
Please do not reply to this message via email. (more info)
- To visit your group on the web, go to:
http://groups.yahoo.com/group/Programmers-Town/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
