4 ms·
You can't: $ cat foo.c #include <stdio.h> main() { const char *foo = "bar"; switch (foo) { case "foo": pri
by mbrubeck 17y ago
You can't:
$ cat foo.c
#include <stdio.h>
main() {
const char *foo = "bar";
switch (foo) {
case "foo":
printf("foo\n");
}
}
$ gcc -pedantic -std=c99 foo.c -o foo
foo.c: In function ‘main’:
foo.c:4: error: switch quantity not an integer
foo.c:5: error: case label does not reduce to an integer constant
- chollida1 17y agoSorry to make you put in so much work. I'm aware that you can't do this. I guess my sarcasm didn't translate:)