Sams Teach Yourself C in 21 Days
Advantages of Modular Programming .......................................................... The primary reason to use modular p ...
Advanced Compiler Use 595 21 5: long sqr(int x) 6: { 7: return ((long)x * x); 8: } LISTING21.3 calc.h: the header file for calc. ...
Link list2101.obj, calc.obj, and any needed functions from the standard library to create the final executable program list2101 ...
Advanced Compiler Use 597 21 Module Components ................................................................................. ...
Because this header file might be included in more than one source file, you want to pre- vent portions of it from compiling mor ...
Advanced Compiler Use 599 21 Using .obj Files .................................................................................. ...
Using the Make Utility .................................................................................. Almost all C compilers ...
Advanced Compiler Use 601 21 The C Preprocessor ................................................................................ ...
#define ZINGBOFFLE printf ZINGBOFFLE(“Hello, world.”); although there is little reason to do so. You should also be aware that s ...
Advanced Compiler Use 603 21 A macro can have as many parameters as needed, but all the parameters in the list must be used in t ...
and you invoke it with the statement OUT(Hello Mom); it expands to this statement: printf(“Hello Mom”); The conversion performed ...
Advanced Compiler Use 605 21 11: return 0; 12: } value is equal to 123. By using the #operator on line 5, the call to the macro ...
For example, to precompile a program named program.c with the Microsoft compiler, you would enter cl /E program.c On a UNIX comp ...
Advanced Compiler Use 607 21 There are two ways to specify the filename for an #includedirective. If the filename is enclosed in ...
Eachstatement_blockconsists of one or more C statements of any type, including pre- processor directives. They don’t need to be ...
Advanced Compiler Use 609 21 Thedefined()operator is useful when you write conditional compilation directives. This operator tes ...
8: /* Header file information goes here... */ 9: 10: 11: 12: #endif Examine what this header file does. On line 3, it checks whe ...
Advanced Compiler Use 611 21 Predefined Macros ................................................................................. ...
Using Command-Line Arguments ...................................................................... Your C program can access ar ...
Advanced Compiler Use 613 21 4: 5: int main(int argc, char *argv[]) 6: { 7: int count; 8: 9: printf(“Program name: %s\n”, argv[0 ...
«
27
28
29
30
31
32
33
34
35
36
»
Free download pdf