Create a gist now

Instantly share code, notes, and snippets.

@ether0x2ca /ptr.c
Last active Jun 28, 2016

#include <stdio.h>
int main(void) {
char mark_1[][5] = {"zyx", "wv", "utsr", "qpo", "nmlk"};
char *mark_2[5] = {"cba", "ed", "ihgf", "lkj", "ponm"};
char *pt_1, **pt_2;
pt_1 = *mark_1;
printf("%s¥n", mark_1[1] + 1);
printf("%s¥n", pt_1 + 1);
pt_2 = mark_2;
printf("%s¥n", *pt_2 + 2);
printf("%c¥n", **pt_2 + 2);
printf("%s¥n", *(pt_2 + 2) + 2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment