Based on an answer of the following question: How do I transform an IF statement with 2 variables onto a switch function using C?
I want to develop SWITCH
and CASE
macros to use it (like switch
and case
) for strings.
Some thing like that:
char buf[256];
SWITCH (buf) {
CASE ("abcdef"):
printf ("A1!\n");
BREAK;
CASE ("ghijkl"):
printf ("B1!\n");
BREAK;
DEFAULT:
printf ("D1!\n");
BREAK;
}
what could be SWITCH
and CASE
and BREAK
and DEFAULT
here ?