How can I check whether my app is compiled in 32-bit or 64-bit ?
This is helpful to debug low level code (working with buffers for example).
How can I check whether my app is compiled in 32-bit or 64-bit ?
This is helpful to debug low level code (working with buffers for example).
You could check the size of a pointer. I think on 32bit it is 4bytes and on 64 it should be 8.
A compile time check would involve
#ifdef
'ing for__LP64__
, which is ARM's data type size standard. A runtime solution would involve checking the size of pointers, like so:Thankfully, pointer sizes are the one thing that the different standards for compiling 64-bit code seem to agree on.