简体   繁体   中英

How binary file can be portable in C programming?

After reading some C programming books, I would like to understand something about portability. C code is portable, but must be recompiled on each machine, so that the compiler can generate the right assembler and binary code for the processor.

Yet, when I download games (portable games) that contain some files, the .exe files work without needing to be recompiled on my machine.

So, how can be there a portable .exe?

All Windows machines use the same two architectures (x64 or x86).

That means that if you want to run on a different architecture, such as Linux, you need to recompile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM