I have very legacy code which migrate from 32 bit machine to 64 bit machine.During my analysis we do lot of calculation on the bit basis.So it might be issue for corrupting data.
So I want to try with size of pointer 4 byte in 64 bit, is it possible that we can declair pointer of 4 byte in 64 machine.The reason for reducing size as we do not have large value. most value varies between 1000 to 10000.
Why are you worried about the size of the pointers? The number of bytes written to and read from the file will have absolutely nothing to do with the size of the pointers. The size of what they point to is a different story. You might find http://en.cppreference.com/w/cpp/types/integer useful for that.
No, its not possible to specify pointer size. the compiler will make them whatever the cpu requires them to be.
16bit machines use a 16bit pointer (2 bytes) max address range is 64KB
32bit machines use a 32bit pointer (4 bytes) max address range is 4 gigabytes
64bit machines use a 64bit pointer (8 bytes) max address range is 16 exbibytes
some 16bit machines had near and far pointers which was a way of accessing many 64KB blocks, and that is how PC's got started and why a 16bit PC could have 512KB or even 640KB of RAM while other 16bit computers still had only 64KB.
cire has the real answer for you, declare your data with the new types identified in cire's link.