Click here to Skip to main content
15,885,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I would like to know i am developing a 'C' codes in Windows operating system. If i take the code and run it in Ubuntu will it work. What are all the areas that has to be modified to make it work.
Posted
Comments
Patrice T 19-Aug-15 2:39am    
Did you try to Google ?
Tomas Takac 19-Aug-15 2:39am    
Depends on the code. If you are only using standard libraries then I don't see why it shouldn't work. Maybe you will need to do some changes, depends on the compiler.

1 solution

C source code, by itself is portable, i.e. you may compile the same source code both on Windows and on Linux (Ubuntu is Linux) and obtain a program showing the same behviour.
However, as you interact with OS API calls (and all but trivial programs do it) the portability is broken, because, for instance Windows provides a Sleep call while Linux does not. So most of C non-trivial programs are non portable.
If you aim to portability, however, there are workarounds: have a look, for instance, at Cygwin[^].
If you aren't stuck with C, then you may consider the 'write once run everywhere' solution (that is Java[^]) or C# (available on Linux via Mono[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900