Created
June 18, 2015 06:02
-
-
Save macrat/0bcb58ba02d9eb24a445 to your computer and use it in GitHub Desktop.
C言語なんか真面目に触っちゃいけないぞ。というお話をしていた。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct stTAMA_CHARS { | |
char t; | |
char a; | |
char m; | |
char A; | |
}; | |
struct stTAMA_INT { | |
int tama; | |
}; | |
int main() | |
{ | |
char* isono[] = {"tama.mother", "tama.father", "tama.next", "tama.father.father"}; | |
struct stTAMA_CHARS tamachar = {1, 2, 3, 4}; | |
struct stTAMA_INT* tamaint = (struct stTAMA_INT*)&tamachar; | |
printf("%s\n", isono[1]); | |
printf("%s\n", 1[isono]); | |
printf("%s\n", &((1[isono])[5])); | |
printf("%s\n", (isono+1)[1]); | |
printf("%s\n", &5[1[&(1[isono+1])]]); | |
printf("%s\n", &(0[&isono[3][5]])); | |
printf("\n"); | |
printf("%02x %02x %02x %02x\n", tamachar.t, tamachar.a, tamachar.m, tamachar.A); | |
printf("%x\n", tamaint->tama); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment