I’m trying to build a switch and I get an “expression must have integral or enum type”. I’m guessing the switch in winapi doesn’t take variables with LPSTR type?
char testbuf[ 51 ]; // allocate space for 50 characters + termination
LPSTR test = testbuf;
scanf("%50s", test); // read at most 50 characters
printf("%s", test);
switch ( test ) {
case "etc" :
{
}
break;
I usually use a kind of dictionary pattern: