Sign in with
Sign up | Sign in
Your question

any difference between compiling in linux and windows

Tags:
  • Windows
  • Linux
  • Programming
  • Business Computing
Last response: in Business Computing
Share
January 29, 2014 8:28:34 AM

can i use same coding for windows and linux.....plz help me out..

More about : difference compiling linux windows

a b L Programming
January 29, 2014 8:31:28 AM

Not really, unless you write very simple programs.
For example in Windows you open a file with a path like "c:\directory\filename", which wouldn't work in Linux.

Most languages usually have something like

#ifdef Windows
...
#else
... Linux code here
#endif

so you could have the same source code for both OSs, rewriting only the parts you have to.
m
0
l
January 29, 2014 8:46:43 AM

aevm said:
Not really, unless you write very simple programs.
For example in Windows you open a file with a path like "c:\directory\filename", which wouldn't work in Linux.

Most languages usually have something like

#ifdef Windows
...
#else
... Linux code here
#endif

so you could have the same source code for both OSs, rewriting only the parts you have to.


bro ..but i mean...when i make a program in linux then i use in terminal vim uday.c
can i write same in windows ..in turbo c++ by yogisoft...thanks for giving me ur valueable time,,!
m
0
l
Related resources
a b 5 Linux
January 30, 2014 3:50:45 AM

uday999 said:
aevm said:
Not really, unless you write very simple programs.
For example in Windows you open a file with a path like "c:\directory\filename", which wouldn't work in Linux.

Most languages usually have something like

#ifdef Windows
...
#else
... Linux code here
#endif

so you could have the same source code for both OSs, rewriting only the parts you have to.


bro ..but i mean...when i make a program in linux then i use in terminal vim uday.c
can i write same in windows ..in turbo c++ by yogisoft...thanks for giving me ur valueable time,,!


Yes, you can edit and compile on either platform as long as you have a compiler for the code language. Go back and forth at will.
m
0
l
!