aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/scanf12.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/scanf12.c')
-rw-r--r--stdio-common/scanf12.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/stdio-common/scanf12.c b/stdio-common/scanf12.c
new file mode 100644
index 0000000000..b557785377
--- /dev/null
+++ b/stdio-common/scanf12.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main (void)
+{
+ double d;
+ int c;
+
+ if (scanf ("%lg", &d) != EOF)
+ {
+ printf ("scanf didn't failed\n");
+ exit (1);
+ }
+ c = getchar ();
+ if (c != ' ')
+ {
+ printf ("c is `%c', not ` '\n", c);
+ exit (1);
+ }
+
+ return 0;
+}