Get the compiler
The compiler that I like and use (there are many different ones available, both free ones and very expensive ones) is called "DJGPP", and I downloaded it for free from www.delorie.com. But don't go there to get it, unless you're an "advanced user", because the download process they use can be confusing. So, I've put together a package of the files you'll need and uploaded them to my website.
Here are the files you need:
prog1.exe (about 3.5 megs)
prog2.exe (about 3.5 megs)
prog3.exe (about 2.2 megs)
Download these three files and save them to the folder c:\download\djgpp compiler (see my Help section if you're unsure how to do this). Once they're downloaded, double-click on them one at a time. You will see a window like this:
Click the Unzip button. Once you've done that for all three files, you're ready to do the simple Windows setup for the compiler. There's no real "installation", just follow the setup instructions below.
Setup for Windows NT/2000/XP users:
If you're running Windows NT/2000/XP, get the properties for "My Computer" by right-clicking on it. Find the section called "Environment Variables", usually on the Advanced tab. You should see a list of variables; look for one called "path" and edit it. Go to the end of what's already there, add a semicolon, and then add c:\djgpp\bin;. You'll also need to add a new variable, named DJGPP, with C:\DJGPP\DJGPP.ENV in the value field.
Once those variables are set and you've restarted your computer, compiling a program is simple. Just go to a command prompt, cd to the folder containing your source code file, and type:
gxx -o myFile.exe myFile.cpp
This will turn your source code file myFile.cpp into the executeable program myFile.exe.
That's it for the installation of the compiler... now move on to the next section.
Setup for Windows 95/98/ME users:
You need to edit the file c:\autoexec.bat on your computer. By now, you know how to get to the contents of your C: drive. Get there, and find the file autoexec.bat, and right-click on it. Choose Edit, and go to the bottom of the file. Make a new line, and add these three lines:
DOSKEY
SET PATH=C:\DJGPP\BIN;%PATH%
SET DJGPP=C:\DJGPP\DJGPP.ENV
Now click File, Save, and then close the window. (Note: if for some reason, your computer doesn't have the file c:\autoexec.bat, create it by choosing File, New, Text Document. Then add those lines to it. It must be in the root of the C: drive -- that is, its address must be C:\autoexec.bat, or the compiler won't work.)
Once those variables are set and you've restarted your computer, compiling a program is simple. Just go to a command prompt, cd to the folder containing your source code file, and type:
gxx -o myFile.exe myFile.cpp
This will turn your source code file myFile.cpp into the executeable program myFile.exe.
That's it for the installation of the compiler... now move on to the next section.