Home

Roedy Green wrote:
> On Sat, 29 Sep 2007 22:56:52 GMT, Erik Wikström
> <Erik-wikstrom@telia.com> wrote, quoted or indirectly quoted someone
> who said :
>
>> Foo f1 = new Foo();
>> Foo f2 = f1;
>>
>> While it does not exactly take the address of the object referred to by
>> f1, it does create a new reference (pointer) that points to the same object.
>
> In assembler, what that does in allocate space for a new Foo object on
> the heap somewhere. It puts the 32-bit address of that object in f1, a
> local variable allocated on the stack frame.
>
> Then it copies the pointer value from f1 and stores it in f2.

N bit address - 32 bit on some platforms.

Arne

previous
next

Re: An Editor that Skips to the End of a Def
iterator problem
Re: The least used keywords in C++, which do you use?
Re: Faster std::map?
Cannot formulate regex
Fundacja Sloneczko
Nasze Dzieci
Mam Marzenie
Fundacja Avalon
Mimo Wszystko