Last active
August 29, 2015 14:08
-
-
Save R2ZER0/7b0702c29dd7c3be88d7 to your computer and use it in GitHub Desktop.
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 "bar.h" | |
#include <stdlib.h> | |
void bar_init(struct bar* self, | |
int member1) | |
{ | |
self->member1 = member1; | |
self->member2 = "Hello, World!"; | |
self->member3 = NULL; | |
} | |
int bar_getmember1(struct bar* self) | |
{ | |
return self->member1; | |
} |
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
struct bar { | |
int member1; | |
union { const char* member2; }; | |
void (*member3)(unsigned short*); | |
union why { | |
struct { | |
int madness[10]; | |
struct { | |
int totally[6]; | |
void* thing; | |
}; | |
}; | |
const char* something; | |
}; | |
}; | |
void bar_init(struct bar*, | |
int member1); | |
int bar_getmember1(struct bar*); |
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 "bar.h" | |
#include <stdio.h> | |
void main(void) | |
{ | |
struct bar my_bar; | |
bar_init(&my_bar, 123); | |
printf("my_bar->member1 = %d \n", bar_getmember1(&my_bar)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment