Ensure C++ will work on a Unix system

For my one college course, my professor said that we have to ensure that the C++ code we send him will work on a Unix system. I in turn installed Cygwin on my Windows 7 machine, and have been using that to compile and check my code, but it sounds like Cygwin is still compiling the code for my Windows based system and may have issues if run on Unix. Since I'm so used to Windows, should I install an easy to use Linux version such as Ubuntu and use that to check my code? Would that ensure it will run on my professor's Unix environment? Thank you.

Of course Cygwin compiles for Windows; it could hardly do otherwise. The difference is that Cygwin provides replacements for UNIX system calls, so that code which builds on UNIX can build in Cygwin and hopefully vice-versa, if your code uses 100% UNIX system calls in a UNIX-compliant manner.

So, your code is, at the very least, going to be a heck of a lot closer than the poor souls who're still trying to hack it with Visual Studio.

I'd be loath to suggest reformatting or trying to set up dual-booting on your computer just to get a Linux/UNIX environment. Too many ways for that to go wrong. Does your school provide shell logins? Can you get a scrap/throwaway computer to install Linux on? Nearly anything with >=40GB HDD and >=256MB RAM will do...

It'd help to know what your professor's UNIX environment is...

Alternatively, you could set-up Ubuntu in a virtual machine, or use wubi

Brgs,
/Lew