Chapter 16. THE C PREPROCESSOR AND THE C LIBRARY

I l @ ve RuBoard

Chapter 16. THE C PREPROCESSOR AND THE C LIBRARY

You will learn about the following in this chapter:

  • Keywords

     #define, #include, #ifdef #else, #endif, #ifndef #if, #elif, enum 
  • Functions

     sqrt(), atan(), atan2() exit(), atexit(), malloc() 

In this chapter, you investigate further the capabilities of the C preprocessor, learning about macro "functions" and conditional compilation. Also, you are introduced to the enum facility and learn more about the C library and dynamic memory allocation.

The ANSI C standard encompasses more than just the C language. It also describes how the C preprocessor should perform, establishes which functions form the standard C library, and details how these functions work. We'll explore the C preprocessor and the C library in this chapter, beginning with the preprocessor.

The preprocessor looks at your program before it is compiled (hence the term pre processor). Following your preprocessor directives, the preprocessor replaces the symbolic abbreviations in your program with the directions they represent. The preprocessor can include other files at your request, and it can select which code the compiler sees. This description does not do justice to its true utility and value, so let's turn to examples. With #define and #include , we have provided examples all along. Now we can gather what you have learned in one place and add to it.

I l @ ve RuBoard


C++ Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 314
Authors: Stephen Prata

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net