Skip to content

Instantly share code, notes, and snippets.

@mattn
Created February 24, 2014 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/9181220 to your computer and use it in GitHub Desktop.
Save mattn/9181220 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int
main(int argc, char* argv[]) {
int i = 2;
static void *foos[] = { &&foo1, &&foo2, &&foo3 };
goto *foos[i];
foo1:
puts("foo1");
goto end;
foo2:
puts("foo2");
goto end;
foo3:
puts("foo3");
goto end;
end:
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment