Sams Teach Yourself C in 21 Days

(singke) #1

Summary ............................................................................................................


Today you covered some of the more advanced programming tools available with C
compilers. You learned how to write a program that has source code divided among mul-
tiple files or modules. This practice, called modular programming, makes it easy to reuse
general-purpose functions in more than one program. You saw how you can use pre-
processor directives to create function macros, for conditional compilation, and other
tasks. Finally, you saw that the compiler provides some function macros for you.

614 Day 21

Graphical IDEs will usually allow you to enter command line arguments into
a dialog box. For example, the Dev-C++ compiler included on the CD of this
book will allow you to enter command line arguments by selecting the para-
meter button on the compilation dialog. Figure 21.5 shows the dialog after
the parameter button has been pressed.

Note


FIGURE21.5
The parameters button.

DOuseargcandargvas the variable
names for the command-line arguments
formain(). Most C programmers are
familiar with these names.

DON’Tassume that users will enter the
correct number of command-line para-
meters. Check to be sure they did; and if
not, display a message explaining the
arguments they should enter.

DO DON’T


33 448201x-CH21 8/13/02 11:16 AM Page 614

Free download pdf