--- In [email protected], "Paul Herring" <[EMAIL PROTECTED]> wrote:
> >> On Sun, 2008-07-27 at 16:31 +0530, saurabh jain wrote:
> >> > In the following line:
> >> > "W64& mem = *(W64*)(W64)addr;"
> >> >
> >>
> >> addr is W64 too? then the cast is unnecessary.
> >
> > Then why does the following code give a seg fault when I uncomment
> > "//W64& mem = *(W64*)(W64)addr;"  ?
> >
> [...]
> >  W64& mem = addr;
> 
> Because the first is treating addr as a pointer, and the second is
> treating addr as a value.
> 
> Try
> 
> W64& mem = *addr;

Gives me compilation error

 error: invalid type argument of 'unary *'

Thanks,
Saurabh

Reply via email to