What's the correct type to use for pointer subtraction on x64?
- by Cheeso
I'm just starting out with x64 compilation.
I have a couple of char*'s, and I'm subtracting them.
With a 32-bit compile, this works:
char * p1 = ....
char * p3 = ...
int delta = p3 - p1;
But if I compile for x64 I get a warning:
warning C4244: 'initializing' : conversion from '__int64' to 'int',
possible loss of data
What is the correct type to use, to represent a difference between two pointers, that works in both x86 and x64 compiles?