Why is it difficult to write portable C programs?

前端 未结 10 2635
野的像风
野的像风 2020-12-14 03:50

I want to know, why is it too hard to make a program run in many OSes, like Windows and Linux, without including glue code. They all share the same architecture (x86), so I

10条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 04:03

    C does give more power compared to other higher level languages.

    Different Processor (CISC and RISC based), 32 and 64bits does put the bit streams of data in different order. There are some supporting APIs to do the conversion, but not totally reliable for all cases.

    Windows and Unix have custom flags which need to be used for building.

提交回复
热议问题