[RESOLVED] Datatype size on 64-bit systems.
I'm still using ye ancient 32-bit machine with ye olde XP.
Currently I'm writing some code to add binary content to files, and I need to know, if the same code can be applied on 64-bit systems.
For example an integer variable added to a binary file with:
Code:
BinaryStream.Write(SomeNumberDeclaredAsInteger)
can be safely loaded with
Code:
MyInteger = BinaryStream.ReadInt32
on my system, but is this also the case on 64-bit systems or should I truncate it to Int32 before writing it to file?
Thanks in advance for any help with this
Tom
Re: Datatype size on 64-bit systems.
According to MSDN, the Integer datatype is equivalent to System.Int32. And as the name implies, System.Int32 will be 32 bit on both 32-bit and 64-bit systems.
This would mean that your code will work alright on a 64-bit system aswell.
Re: Datatype size on 64-bit systems.
The thing that changes size between 32-bit and 64-bit systems is an IntPtr. It basically represents a memory address, so it will be as wide as that needs.
Re: Datatype size on 64-bit systems.
Big thanks to both.
Thread resolved!