Created
October 23, 2014 12:14
-
-
Save nscooling/49d29f77c381f8224dbe 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> | |
#include <limits.h> | |
#include <assert.h> | |
int main(void) | |
{ | |
assert(sizeof(unsigned char)==1); | |
unsigned char uc1 = 0xff; | |
unsigned char uc2 = 0; | |
if(~uc1 == uc2) { | |
printf("%hhx == %hhx\n", ~uc1, uc2); | |
} else { | |
printf("%hhx != %hhx\n", ~uc1, uc2); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment