Back to index

glibc  2.9
scanf5.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 a, b;
00008 
00009   a = b = -1;
00010   sscanf ("12ab", "%dab%n", &a, &b);
00011   printf ("%d, %d\n", a, b);
00012   if (a != 12 || b != 4)
00013     abort ();
00014 
00015   a = b = -1;
00016   sscanf ("12ab100", "%dab%n100", &a, &b);
00017   printf ("%d, %d\n", a, b);
00018   if (a != 12 || b != 4)
00019     abort ();
00020   return 0;
00021 }