c - How does preprocessor make that expansion (define macro found in included header file ) -


i have header file contain constant f_cpu , use macro guard

header.h

#ifndef f_cpu #define f_cpu  1000000ul #endif 

and source.c file

#define f_cpu 16000000ul #include "header.h" 

how first macro(in c file ) expand value not included yet?

use -e option of preprocessor follow happens. define f_cpu macro in first line of source.c , after when header file included, macro definition in header not takes place because of #ifndef guard. note there no macro expansion in code. expansion takes place when use macro.


Comments

Popular posts from this blog

My HTML document is not linking to my CSS stylesheet properly -

php array slice every 2th rule -

node.js - Sending sockets to client side, Error: Converting circular structure to JSON -