Computer Programming (12) - C Preprocessor, Memory Allocation


administrivia

Web Page - http://www.cs.tau.ac.il/~efif/courses/ComputerProgramming


the C Preprocessor


the C Preprocessor syntax


file inclusion


the difference between the <> and ""


what should you put in header files?


what should you put in header files?


using a third-party library


macro definition and substitution


macro name and replacement text


macro use


macro definition and substitution syntax


macro evaluation


macros which look like little functions


conditional compilation


other directives


conditional compilation is useful


example


conditional compilation is useful


allocating memory with malloc


memory allocation


managing allocated memory


allocating memory for charcters


allocating memory for integers


accesing allocated memory


verifying allocated memory


freeing memory


recycling memory


avoid misusing pointer to dealocated memory


keeping track


reallocating memory blocks


example


prototype


pointer safety


be careful when pointing to arrays


be most careful when allocating memory dynamically

lectures prev top next
Maintained by Efi Fogel. Last modified: August 20 2003.