Created
September 16, 2008 18:53
-
-
Save jeremyBanks/11102 to your computer and use it in GitHub Desktop.
[2010-01] looking at scanf, i guess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//&>/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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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