Skip to content

Instantly share code, notes, and snippets.

@ryands
Created February 25, 2015 17:15
Show Gist options
  • Save ryands/8549699062e7057bf66a to your computer and use it in GitHub Desktop.
Save ryands/8549699062e7057bf66a to your computer and use it in GitHub Desktop.
demonstrating casting and overflow (trivial)
/* gcc -o cast cast.c */
#include <stdio.h>
int main(int argc, char **argv) {
unsigned long sides;
int input = -5;
sides = input;
printf("Catas input %lu\n", sides);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment