Skip to content

Instantly share code, notes, and snippets.

@diogovk
Created September 3, 2014 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogovk/4a6fa068ada721ccab52 to your computer and use it in GitHub Desktop.
Save diogovk/4a6fa068ada721ccab52 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void printhex(signed char c) {
printf("%x %d\n", c , c );
}
int main(){
printhex(0x0); /* => 0 0 */
printhex(0x30); /* => 30 48 */
printhex(0x1f); /* => 1f 28 */
printhex(0x7c); /* => 7c 124 */
printhex(0xe4); /* => ffffffe4 -28 */ /* << WHAT???? */
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment