Created
June 4, 2012 01:49
-
-
Save gcmurphy/2865833 to your computer and use it in GitHub Desktop.
alignment
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> | |
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