Back to index

glibc  2.9
scanf1.c
Go to the documentation of this file.
00001 #include  <stdio.h>
00002 #include  <stdlib.h>
00003 
00004 int
00005 main (int argc, char *argv[])
00006 {
00007   int i,n,r;
00008 
00009   n = i = r = -1;
00010   r = sscanf ("1234:567", "%d%n", &i, &n);
00011   printf ("%d %d %d\n", r, n, i);
00012   if (r != 1 || i != 1234 || n != 4)
00013     abort ();
00014   return 0;
00015 }