say i got this code..
Code: Select all
typedef struct {
void (*blah)(void);
}t_blah;
t_blah *blah;
void init_tester();
#define tester
#define init(NAME) init_##NAME
void main() {
blah->blah = init(tester);
}
is there a way that i can get it to do the value of NAME instead of the actual name, so u can have something like this,...
Code: Select all
typedef struct {
void (*blah)(void);
} t_blah;
t_blah *blah;
void init_hello();
void init_temp();
void main() {
char temp[0x05];
strcpy(temp,"hello");
blah->blah = init(temp);
}
#define init(NAME) init_##NAME
will call init_temp(); , but i want it to call
init_hello();..... i've tried init("hello"), but that
just returns 0 :(
any help folks ?
thanks in advanced....
- Steven