Anyone know how to check if a machine is 16 bit, 32 bit etc?
I need to make my C++ program portable,
but I'm not sure what macro can I use to accomplish this
That's simply not possible standard-wise: it actually does not make any sense whatsoever.
In practice, however, sizeof(void*) can be used as a hint to detect whether you're compiling in a 32-bit or 64-bit environment, though it is useless as a preprocessor token.
CHAR_BIT and sizeof(void *) are the closest things C has to a concept of "bit width." All standard integer types must be supported on all C implementations and it's possible for a machine with e.g. 64-bit data registers to use a 16-bit int or for a machine to have 128-bit pointers and a 16-bit size_t.