R
Ravi
Hi,
I have this
#define KB 1
#define KB_AM 33
#define KB_RM 44
#define AM 2
#define RM 3
#define STR_KB 9
#define STR_AM 10
#define STR_RM 11
void map_fn( int config)
{
int temp;
switch(config) {
case KB:
case KB_AM:
case KB_RM:
if (config == KB)
fill_up (... , STR_KB);
else if (config == KB_AM
fill_up (... , STR_KB_AM);
else if (config == KB_RM)
fill_up (... , STR_KB_RM);
break;
case AM:
fill_up (..., STR_AM);
break;
}
How can i have a macro which based on the 'config value' pre-appends
'STR_' to it and
call fill_up() function.
Inside fill_up() it should give appropriate #defined values for
STR_KB/STR_KB_RM/...etc.
TIA
- Ravi
I have this
#define KB 1
#define KB_AM 33
#define KB_RM 44
#define AM 2
#define RM 3
#define STR_KB 9
#define STR_AM 10
#define STR_RM 11
void map_fn( int config)
{
int temp;
switch(config) {
case KB:
case KB_AM:
case KB_RM:
if (config == KB)
fill_up (... , STR_KB);
else if (config == KB_AM
fill_up (... , STR_KB_AM);
else if (config == KB_RM)
fill_up (... , STR_KB_RM);
break;
case AM:
fill_up (..., STR_AM);
break;
}
How can i have a macro which based on the 'config value' pre-appends
'STR_' to it and
call fill_up() function.
Inside fill_up() it should give appropriate #defined values for
STR_KB/STR_KB_RM/...etc.
TIA
- Ravi