Last active
July 12, 2016 02:58
-
-
Save yukpiz/cf7ecfccc965063f51cc39746ff6bb28 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <stdlib.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
void main() | |
{ | |
uint32_t nr1 = (uint32_t)-1; | |
uint32_t nr2 = (uint32_t)0xffffffffUL; | |
printf("%d\n", nr1); | |
printf("%d\n", nr2); | |
printf("%d\n", sizeof(uint32_t)); | |
if (sizeof(uint32_t) != 4) | |
{ | |
printf("uint32_t size not 4."); | |
exit(1); | |
} | |
if (nr1 != 0xffffffffUL) | |
{ | |
printf("nr1 error."); | |
exit(1); | |
} | |
if (nr2 + 1 != 0) | |
{ | |
printf("nr2 error."); | |
exit(1); | |
} | |
printf("all ok"); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment