Portable C - muneeb-mbytes/computerArchitectureCourse GitHub Wiki
Why C language is portable?
Portability generally means the thing which can be carried or moved easily from one place to another. C is called portable language because if you write a C code in your machine, it will run on any machine which supports C, without(or with very few modifications) modifying a single line of code. Because it is not tied to any hardware or system. We can say, it is a hardware independent language or platform independent language.
For example:
Generally the conversion of source code to machine understandable code takes place as shown below:
The source code cannot be run by machines because machines can understand only machine language (in terms of 0’s and 1’s). We require an intermediate step which converts high level language to an object code using compiler. This is called as assembly code with .obj extension. Suppose if we directly convert source code to binary code it would be machine specific. Therefore, the portability is achieved due to intermediate object file.