Skip to content

Instantly share code, notes, and snippets.

@gcmurphy
Created June 4, 2012 01:49
Show Gist options
  • Save gcmurphy/2865833 to your computer and use it in GitHub Desktop.
Save gcmurphy/2865833 to your computer and use it in GitHub Desktop.
alignment
#include <stdio.h>
int main()
{
void *p;
if (((unsigned long)p) & 15 == 0)
puts("16 bit aligned");
if (((unsigned long)p) & 23 == 0)
puts("24 bit aligned");
if (((unsigned long)p) & 31 == 0)
puts("32 bit aligned");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment