Quote:
|
Originally Posted by teknomage1
I'm not sure whether your ints are longs or shorts, but I think int defaults to short, right? [/code]
|
int doesn't default to anything.
On x86, int has a size of 4 bytes, short of 2 bytes, and long of 4 bytes. On x86-64, long is 8 byte, int is 4 byte, and short is 2 byte. However, shorts are generally promoted to 4 bytes by many compilers.
Other architectures vary, but int's aren't "longs or shorts", they're ints, and even those numbers above can vary with the compiler.
As for the OP, that code should work, but are you storing 1 integer in 4 slots or 4 integers in that array? That is, is it a big int, because if it is, you may have to modify that code.