Programming C on your home PC

If have a computer at home which you wish to use for C programming then there are a number of alternatives. The best solution is to install Linux which is freely available and free to download. However, it can be tricky to get working and I would not recommend this unless you are particularly expert.

The next best solution is Cygwin which will allow you to program C in an environment very like the unix one used on the course. (One main difference is that the C compiler is called gcc not cc). You can then write programs with whatever editor you like and compile and run them as you would on campus.

Alternatively, feel free to use any other C compiler you have available. However, it is important to write C programs, not C++ programs. C++ is a very different (and more complex) language than C but does look very like C. Many modern compilers are both C and C++ compilers. If you use one of these then make sure you switch it to just ANSI standard C.

It is important that before handing them in you check that any programs you wrote at home work properly on the campus system. One source of incompatibility between windows and unix systems is in the way that files are stored. This can sometimes cause problems with end of line characters. On tower you can use the command dos2unix to remove these as shown below.

dos2unix programname.c > newprogramname.c