using macro defined in header files
Posted
by Neeraj
on Stack Overflow
See other posts from Stack Overflow
or by Neeraj
Published on 2010-04-07T12:56:23Z
Indexed on
2010/04/07
13:13 UTC
Read the original article
Hit count: 356
I have a macro definition in header file like this:
// header.h
ARRAY_SZ(a) = ((int) sizeof(a)/sizeof(a[0]));
This is defined in some header file, which includes some more header files.
Now, i need to use this macro in some source file that has no other reason to include header.h
or any other header files included in header.h
, so should i redefine the macro in my source file or simply include the header file header.h
.
Will the latter approach affect the code size/compile time (I think yes), or runtime (i think no)?
Your advice on this!
© Stack Overflow or respective owner