Back to Main Page
On to Next Lecture
Type in the program or load the above program and save it to your hard drive. Once you think you have the source file correct, compile and run it using your compiler. If you are using a Borland compiler, click on the "thunderbolt" button to compile and run the program.
If your program is set up correctly, the program will run and display the message, then terminate.
Depending on the compiler you are using and how it is set up, one of two things will happen when your program finishes.
If your compiler closes the window when done, you will have to make the program to pause before it terminates, so you can see what the program does. This can be done in hello2.c by adding a call to the getchar() routine, which causes the program to pause until you press the ENTER key. If this is the way your compiler behaves, add this line to all your programs.
A commented version ( hello3.c) of the "Hello, World" program will give you more information on what the various lines mean.