1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(int argc,char * argv[])5main(int argc, char *argv[]) 6 { 7 int a, b; 8 9 a = b = -1; 10 sscanf ("12ab", "%dab%n", &a, &b); 11 printf ("%d, %d\n", a, b); 12 if (a != 12 || b != 4) 13 abort (); 14 15 a = b = -1; 16 sscanf ("12ab100", "%dab%n100", &a, &b); 17 printf ("%d, %d\n", a, b); 18 if (a != 12 || b != 4) 19 abort (); 20 return 0; 21 } 22