E
Erik Arle
Hi,
I want to have a macro that includes a bunch of
include files and functions into my code when called.
Here is an example:
#define MY_MACRO() #include <a.h>\
#include <b.h>\
...
f()\
{\
printf("Hello\n");\
}\
This is not syntacally right since the "#" before the include
is interpreted as a stringizig char and an error is flagged by
the compiler. Also, all the code is placed n a single line,
the includes flag an error. How can you write a macro like this??
I have a large number of files in which I need to include
code like this. Any help is greatly appreciated.
I want to have a macro that includes a bunch of
include files and functions into my code when called.
Here is an example:
#define MY_MACRO() #include <a.h>\
#include <b.h>\
...
f()\
{\
printf("Hello\n");\
}\
This is not syntacally right since the "#" before the include
is interpreted as a stringizig char and an error is flagged by
the compiler. Also, all the code is placed n a single line,
the includes flag an error. How can you write a macro like this??
I have a large number of files in which I need to include
code like this. Any help is greatly appreciated.