Skip to content

Instantly share code, notes, and snippets.

@djboris9
Created October 6, 2016 19:27
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 djboris9/b3762a8a840cf35ac6684351c6db6965 to your computer and use it in GitHub Desktop.
Save djboris9/b3762a8a840cf35ac6684351c6db6965 to your computer and use it in GitHub Desktop.
#include <stdio.h>
typedef struct ItemIdData
{
unsigned lp_off:15,
lp_flags:2,
lp_len:15;
} ItemIdData;
void main() {
const char data[] = {0x80, 0x9f, 0xf2, 0x00};
ItemIdData *item = &data;
printf("%i\n", item->lp_off);
printf("%i\n", item->lp_flags);
printf("%i\n", item->lp_len);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment