32bit or 64bit
snippet in c

32bit or 64bit

user9892

grep flags /proc/cpuinfo


Explanation(only in linux):
Look for "lm" in the command output. If lm is found in the output, then the CPU is 64-bit. If you don't see lm or see i386, i486, i586, or i686 in the output, then the CPU is 32-bit. Below is an example output of the above line with lm in the information.