Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMartins Mozeiko

Posted 11 April 2013 - 11:17 PM

I don't think that casting from void* to A* will change address. Cating from B* to A* - yes it can, but not from void*.


I think in this case author is allocating memory with new [] and array allocation stores length in first 4 bytes, that's why it returns address with +4 offset.


#1Martins Mozeiko

Posted 11 April 2013 - 11:16 PM

I don't think that casting from void* to A* will change address. Cating from B* to A* - yes it can, but not from void*.


I think in this case author is allocating memory with new [], and array allocation stores length in first 4 bytes, that's why it returns address with +4 offset.


PARTNERS