Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
#include <stdio.h>
#include <limits.h>
#include <assert.h>
int main(void)
unsigned int ui = MAGIC_NUMBER;
unsigned short us = ui;
unsigned char uc = us;
int si = MAGIC_NUMBER;
short ss = si;
signed char sc = ss;
printf("%10u %5hu %4hhu\n", ui, us, uc);
printf("%10x %5hx %4hhx\n", ui, us, uc);
printf("%10d %5hd %4hhd\n", si, ss, sc);
printf("%10x %5hx %4hhx\n", si, ss, sc);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment