Created
October 30, 2012 05:43
-
-
Save yppp/3978510 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 <stdio.h> | |
#define GET_FIRST(x) ((*(pack*) &x).first) | |
#define GET_SECOND(x) ((*(pack*) &x).second) | |
typedef struct pack_tag | |
{ | |
unsigned short first; | |
unsigned short second; | |
} pack; | |
int main() | |
{ | |
int x = 0; | |
for(x = 0; GET_FIRST(x) < 100; GET_FIRST(x)++) | |
{ | |
GET_SECOND(x) += GET_FIRST(x) + 1; | |
printf("%d\n", GET_FIRST(x)); | |
printf("%d\n", GET_SECOND(x)); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment