Thursday, January 20, 2011

The Four Steps to build a C program

Four steps are required in order to build any program in C. They are save, com­pile, link, and run. Most C programming language packages automatically per­form the linking step, though whether or not it’s done manually, it’s still in there.

Save! Saving means to save your source code. You create that source code in a text editor and save it as a text file with the C (single letter C) extension.

Compile and link! Compiling is the process of transforming the instructions in the text file into instructions the computer’s microprocessor can under­stand. The linking step is where the instructions are finally transformed into a program file. (Again, your compiler may do this step automatically.)

Run! Finally, you run the program you have created. Yes, it’s a legitimate pro­gram, like any other on your hard drive. You have completed all these steps in this chapter, culminating in the cre­ation of the GOODBYE program. That’s how C programs are built. At this stage, the hardest part is knowing what to put in the source file, which gets easier as you progress through this book. (But by then, getting your program
to run correctly and without errors is the hardest part!)

You find the instructions to save, compile, and run often in this book. That’s because these steps are more or less mechanical. What’s more important is understanding how the language works. That’s what you start to find out about in the next chapter.

Welcome to reproduce this passage. Please indicate the source when you reproduce this passage.

No comments:

Post a Comment