Possible Duplicate:
Determine word size of my processor
I am trying to implement the multiplicative method for hashing as described on: http://homepages.ius.edu/rwisman/C455/html/notes/Chapter11/MulMethod.htm
In order to this I first calculate the “key” using bernstein’s method. The next step is where I get stuck. How do I determine the word-size of the machine if my implementation is to be used on many different computers?
I don’t see where the word size of the computer matters, all calculations are done on variables and such. For example, the original Microsoft BASIC interpreter ran on 8 bit machines with no hardware floating point, yet it supported floating point in software. In your case, C++, you will have to re-compile your program for each different machine instruction set so you can use “sizeof().”