![]() |
| | #1 |
| Registered User Join Date: Feb 2002
Posts: 26
| syntax |
| ghe1 is offline | |
| | #2 |
| Registered User Join Date: Aug 2001
Posts: 202
| 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 |
| starX is offline | |
| | #3 |
| Registered User Join Date: Feb 2002
Posts: 26
| 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. |
| ghe1 is offline | |
| | #4 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,710
| > 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 Code: #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 |
| Salem is offline | |
| | #5 |
| Registered User Join Date: Feb 2002
Posts: 26
| Thanks for the advice. That is what I have been needing! |
| ghe1 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| more then 100errors in header | hallo007 | Windows Programming | 20 | 05-13-2007 08:26 AM |
| We Got _DEBUG Errors | Tonto | Windows Programming | 5 | 12-22-2006 05:45 PM |
| Using VC Toolkit 2003 | Noobwaker | Windows Programming | 8 | 03-13-2006 07:33 AM |
| Connecting to a mysql server and querying problem | Diod | C++ Programming | 8 | 02-13-2006 10:33 AM |
| Dikumud | maxorator | C++ Programming | 1 | 10-01-2005 06:39 AM |