Skip to content

Instantly share code, notes, and snippets.

@madgen
Last active November 9, 2016 11:07
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 madgen/8ffb7e810614b7db351852d07486d134 to your computer and use it in GitHub Desktop.
Save madgen/8ffb7e810614b7db351852d07486d134 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
char *cptrs[6] = { "hello", "mellow", "yellow" };
char **cptrs2;
void **vptrs = (void**) cptrs;
vptrs++;
cptrs2 = (char**) vptrs;
printf("%s\n", *cptrs2); // Prints mellow
vptrs++;
cptrs2 = (char**) vptrs;
printf("%s\n", *cptrs2); // Prints yellow
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment