You think so! Time to think again. :)


#include<iostream>

using namespace std;



int main(void)

{

     int a=10 ,b=4;

       int& c=a;



       cout<<"\n-"<<a;

       a+=20;

       cout<<"\n-"<<c;

       /********************/

       //Addyour code here.



       *(unsigned long*)(((unsigned long)&b)-((unsigned long)&a-(unsigned
long)&b)) = (unsigned long)&b;



       /*********************/





       cout<<"\n-"<<c;

                  c=999;

       cout<<"\n-"<<b;





       cin.get();

      return 0;

}




On Tue, Jul 12, 2011 at 1:06 PM, Anand Saha <[email protected]> wrote:

> Yep, and http://www.parashift.com/c++-faq-lite/references.html#faq-8.5
>
> --
>
>
> On Tue, Jul 12, 2011 at 12:50 PM, sunny agrawal 
> <[email protected]>wrote:
>
>> Once a reference is initialized to an object, it cannot be changed to
>> refer to another object.
>> Ref. Bruce Eckel - ch11
>>
>> So its Not possible
>> --
>> Sunny Aggrawal
>> B-Tech IV year,CSI
>> Indian Institute Of Technology,Roorkee
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Regards,
Ashish

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to