What are the major differences of the linux syntax in comparision to windows syntax while programming?
What are the major differences of the linux syntax in comparision to windows syntax while programming?
In Java, and Perl, very little.
In C, maybe nothing, maybe a lot, it depends on what you're trying to do. By an large the differences come when you use libraries that are unique to a certain operating system.
If you gave me a better idea of what you're trying to do, I can give you a more definite answer,
starX
www.axisoftime.com
My situation is this: I have a c program that determines the free disk space on a drive. Within this code, I need to add a function that is called before the rest of the code executes to determine whether or not I am in a windows environment or in a linux environment. I also have code for the unix side, "statvfs" that determines the disk space.
> to determine whether or not I am in a windows environment or in a linux environment.
No such function exists
You need to compile the code with conditional compilation directives, like so
Then you compile it for LINUX usingCode:#ifdef LINUX space = statvfs(); #elif WINDOWS space = GetDiskFreeSpace(); // or whatever #else #error Not LINUX or WINDOWS #endif
gcc -DLINUX prog.c
and for windows
cl -DWINDOWS prog.c
Thanks for the advice. That is what I have been needing!