You have the option between two different compilers. The first (and best) choice is Bloodshed Dev C++. Just click on the link, scroll down to the desired version and click one of the download links at the bottom of its respective section. Then install, open a new source code file and start programming! The second, older option is a little more involved and much less user friendly, but I'll keep it alive for those who wish to have a Borland compiler.

First off, you get the compiler here. It's the second option down the table - "Compiler" (There is now a free registration required).

Now that you've got the compiler, unpack it to whatever folder you want and follow the instructions on how to make it work. They're a little ambiguous so here's how to do it:

First, navigate to the bin directory of the unpack - if you chose the default path, it's c:\Borland\Bcc55\bin. Now, create a text file and insert this into it:

-I"<file path to include>"
-L"<file path to lib>"


Where <file path to include> is the file path to the include folder. Default is c:\Borland\bcc55\Include. Same with <file path to lib>. The default is c:\Borland\bcc55\lib. Now, save it as "bcc32.cfg" in quotes. Without the quotes, it'll save it as bcc32.cfg.txt. Assuming you use defaults, the file will look like this:

-I"C:\Borland\Bcc55\include"
-L"C:\Borland\Bcc55\lib"

This is just telling the compiler where the include files are - you know, those files that you point to in #include statements.

Next, create another text file and insert the following into it:

-L"<file path to lib>"


Again, where <file path to lib> is the file path to the lib directory. Now save it as "ilink32.cfg" in quotes. This just tells the linker (don't ask what it is...I don't remember either) where to look for the lib directory.

If you're not in Windows XP, you're on your own from here on in. Go here and check out the instructions yourself.

Now. Here comes the interesting part. If you're in Windows XP, right click on My Computer, and select properties. Click on the Advanced tab, then at the bottom of the window, click on Environmental Variables. Next, go to the bottom of the two windows and find the selection entitled "Path". Select it, click "Edit", and add the file path to your bin directory (the default path is ";C:\Borland\BCC55\Bin" without the quotes) to the very end of the string of text. Doing this tells the computer that the compiler is allowed to do what it's gotta do. I'm not exactly sure what that is - I think it has something to do with letting the compiler look at environmental variables that your computer stores. Anyways, restart your computer.

Now, go to the bin directory (default is c:\Borland\bcc55\bin), and create another text file. Write your program into it, and save it as "whatever.cpp" with the quotes. Now, Windows XP users go to Start -> All Programs -> Accessories -> Command Prompt. Everyone else just find MS DOS Prompt - it's probably in your accessories folder as well. Now, type in CD (default is c:\Borland\bcc55\bin) - you'll notice that the directory now defaults to the bin directory. This isn't mandatory, but it's much more convenient. Finally, type in bcc32 and then the name of your program. So if the file was called hello.cpp, you'd type in bcc32 hello. This is calling the program bcc32.exe, and feeding it the file you want to compile. It doesn't have to be in the same directory as the compiler though - you could type in bcc32 "c:my documents\my programs\whatever.cpp" if you wanted. You don't even have to call bcc32 from the bin directory - you could call it from anywhere you wanted, but being in the bin directory just makes things go a lot faster.

Now, press enter and watch as it compiles your program and gives you any errors that occured. If you get an error telling you that it can't find an include file, then you entered the wrong path in your bcc32.cfg file. Confirm that it's correct and try again. If you get any linker errors, go to ilink32.cfg and ensure that it's giving the right filepath. Finally, if you get something along the lines of "unable to compile", then you'll want to check that the path you entered into the environmental variables is correct.

If no errors occurred, type in hello (assuming you've defaulted to the bin directory), and your program will execute. You can also navigate to the bin directory and find your hello.exe program. However, if you only set it to output information, and you ran the program directly from the .exe file, you'll find that the window just flashes on the screen and disappears.

To get rid of this annoying little limitation, just put the whole program in a do-while statement, and ask yourself if you'd like to continue, like so:

#include <iostream.h>

int main()
{
  int go_again;
  do
  {
    cout << "Hello!\n" << "Would you like to continue?\n";
    cout << "Anything Other Than 0)  Yes\n";
    cout << "0)  No\n";
    cin >> go_again;
  }while(go_again != 0);
  return 0;
}

This will make the program stay open until you tell it to close. And when it closes, the window will close as well. Congratulations! You can officially check your own C++ work!