Search code examples
rust

reading address represented by pointer member of vec


A vec has three members: length, capacity and a pointer to heap memory. vec provides methods len and capacity to rad those values, but no such method for pointer value.

Is it anyway possible to address value pointer holds?


Solution

  • There are in fact two methods to retrieve the managed pointer value: