lec08

lec08 - The Preprocessor CS 2022: Introduction to C...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The Preprocessor CS 2022: Introduction to C Instructor: Hussam Abu-Libdeh Cornell University (based on slides by Saikat Guha) Fall 2009, Lecture 8 The Preprocessor CS 2022, Fall 2009, Lecture 8 Preprocessor I Commands to the compiler I Include files, shortcuts, conditional compilation I Command must start at beginning of line Common preprocessor commands I #include I #define I #ifdef / #ifndef The Preprocessor CS 2022, Fall 2009, Lecture 8 Running just the preprocessor gcc-E-o preprocessed .c project.c The Preprocessor CS 2022, Fall 2009, Lecture 8 #include : Header Files I Includes files: Literally copy-paste I Typically header files Header File Declares I External functions I Variable types I External global variables Typically named *.h (or sometimes *.hpp for C++) The Preprocessor CS 2022, Fall 2009, Lecture 8 #include : Header Files mylib.h int max(int a, int b); mylib.c #include "mylib.h" int max(int a, int b) { return (a > b ? a : b); } The Preprocessor CS 2022, Fall 2009, Lecture 8 #include...
View Full Document

This document was uploaded on 03/10/2011.

Page1 / 17

lec08 - The Preprocessor CS 2022: Introduction to C...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online