Skip to content

Instantly share code, notes, and snippets.

@jeremyBanks
Created September 16, 2008 18:53
Show Gist options
  • Save jeremyBanks/11102 to your computer and use it in GitHub Desktop.
Save jeremyBanks/11102 to your computer and use it in GitHub Desktop.
[2010-01] looking at scanf, i guess
//&>/dev/null;x="${0%.*}";[ ! "$x" -ot "$0" ]||(rm -f "$x";cc -o "$x" "$0")&&"$x" $*;exit
#import <stdio.h>
int main(int argc, char* argv[]) {
int i;
double d;
scanf("%d", &i);
printf("i = %d, d = %lf\n", i, d);
scanf("%lf", &d);
printf("i = %d, d = %lf\n", i, d);
}
4 ab
i = 4, d = 0.000000 (undef)
i = 4, d = 0.000000
3 4.5
i = 3, d = 0.000000 (undef)
i = 3, d = 4.500000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment