Back to index

glibc  2.9
scanf12.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 
00004 int
00005 main (void)
00006 {
00007   double d;
00008   int c;
00009 
00010   if (scanf ("%lg", &d) != 0)
00011     {
00012       printf ("scanf didn't failed\n");
00013       exit (1);
00014     }
00015   c = getchar ();
00016   if (c != ' ')
00017     {
00018       printf ("c is `%c', not ` '\n", c);
00019       exit (1);
00020     }
00021 
00022   return 0;
00023 }