Skip to content

Instantly share code, notes, and snippets.

@h-hirai
Last active May 11, 2018 08:06
Show Gist options
  • Save h-hirai/253bf06a65eb142dfc0fee0d14d26783 to your computer and use it in GitHub Desktop.
Save h-hirai/253bf06a65eb142dfc0fee0d14d26783 to your computer and use it in GitHub Desktop.
I didn't know inttypes.h
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
int main() {
uint8_t u8 = UINT8_MAX;
uint16_t u16 = UINT16_MAX;
uint32_t u32 = UINT32_MAX;
uint64_t u64 = UINT64_MAX;
printf("%" PRIu8 "\n", u8);
printf("%" PRIu16 "\n", u16);
printf("%" PRIu32 "\n", u32);
printf("%" PRIu64 "\n", u64);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment