V
Venky
Hello,
I have situation to put # character in macros.
Eg:
I have to include file1 ,file2, and file3 in a file.
#ifndef file1
#include<file1.h>
#endif
#ifndef file2
#include<file2.h>
#endif
#ifndef file3
#include<file3.h>
#endif
I want to add a macro to do the above task
#define INCLUDE(x) #ifndef #x \
#include<#x.h> \
#endif
and then i want to use INCLUDE(file1)
INCLUDE(file2) ...etc.,
But as you all know, macro thinks that all "#" are for stringizing
characters. But i want to tell that macro that this # is special
character and don't treat it as stringizing character.
Any help ?
Thanks,
Venkatesh.
I have situation to put # character in macros.
Eg:
I have to include file1 ,file2, and file3 in a file.
#ifndef file1
#include<file1.h>
#endif
#ifndef file2
#include<file2.h>
#endif
#ifndef file3
#include<file3.h>
#endif
I want to add a macro to do the above task
#define INCLUDE(x) #ifndef #x \
#include<#x.h> \
#endif
and then i want to use INCLUDE(file1)
INCLUDE(file2) ...etc.,
But as you all know, macro thinks that all "#" are for stringizing
characters. But i want to tell that macro that this # is special
character and don't treat it as stringizing character.
Any help ?
Thanks,
Venkatesh.