-
Jun 17th, 2011, 07:48 AM
#1
Thread Starter
Fanatic Member
[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
In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)
-
Jun 17th, 2011, 08:19 AM
#2
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.
-
Jun 17th, 2011, 08:36 AM
#3
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.
-
Jun 17th, 2011, 09:46 AM
#4
Thread Starter
Fanatic Member
Re: Datatype size on 64-bit systems.
Big thanks to both.
Thread resolved!
In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|