I am converting from C to C++ and I did not know about reinterpret_cast.
Thank you
Greg
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
Greg wrote:
> I have a MemPtr that is as a pointer to a custom structure
> (pdbLayout)
>
> PDBData = static_cast(MemPtrNew(size));
>
> This is also the start of my data.
>
> I have a second pointer (Char* pOffset) that locates the
> end of the data.
>
> How can I find the size of the data?
As
If you are asking a basic 'C' question, then the following will work just fine:
unsigned long size;
size = (unsigned long)((char *)pOffset - (char *)PDBData) + 1;
Otherwise, you are asking a basic 'C++' question, so might I recommend
the following:
unsigned long size;
size = static_cast(reinter
I have a MemPtr that is as a pointer to a custom structure (pdbLayout)
PDBData = static_cast(MemPtrNew(size));
This is also the start of my data.
I have a second pointer (Char* pOffset) that locates the end of the data.
How can I find the size of the data?
This is not the right way ---
siz