by David Hamrick

Home
Links

Starting Out
Compiler
Hello World Program
Comments

Variables
Int, Char, Float

Scanf

Projects
ATM project
Maze project
Unit Conversion project





Compiler

In order to start writing C Programs your going to need to have a Compiler. I personally like using the Borland Command Line tools. Borland have released them for free use. You can get them here. When you are there download the compiler. I would suggest putting in in C:\BC55\

Before you start making programs you need to go to the directory where you installed the compiler and go into the directory bin. Then edit bcc32.cfg. If it doesn't exist make one. Put the following in that file

-I"c:\Bc55\include"
-L"c:\Bc55\lib;C:\Bc55\lib\psdk"

One last step before your ready to start. You have to add the bin directory of the compiler to the path. This lets us use all the programs that the compiler uses without typing the whole path into the command line. To do this on Windows XP we go to start and right click on My Computer and go all the way down to properties. Then go to the advanced tab. Then click on environment variables. Edit the system variable called Path. At the very end type in C:\BC55\bin;. Make sure you add the semi colon at the end.

Once you have the Borland Compiler your going to need to start writing things to compile. To test your compiler enter the following into a text editor and save it as helloworld.cpp

#include <stdio.h>

int main()
{
  printf("Hello World");
  return 0;
}

Then type bcc32 helloworld.cpp into your command line. It should run just fine and then type helloworld. the words Hello World should appear on your command line after you start the program. If all that worked fine then your compiler works great. If not start from the beginning and try again.

 

Hosted by www.Geocities.ws

1