If by "some code in C" you mean the standard code C, then the answer is "no", this is impossible. For program C, the "world" that he sees is completely created by the implementation (compiler). The compiler can emulate absolutely any "world" that is completely unrelated to the basic equipment.
For example, you can run a 32-bit compiler on a 64-bit machine, and you can never find that it is a 64-bit machine from your program.
The only way to learn something about the machine is to access some non-standard tools, for example, a specific API. But that goes far beyond C.
It is unnecessary to add that the ones already proposed in other response methods, based on sizeof and other standard language tools, do not even detect the proximity of the machine. Instead, they discover the platform’s bit platform provided by the compiler implementation, which in the general case is completely different.
source share