Update from main archive 960811
[glibc/history.git] / stdio-common / scanf2.c
blob06c97c669a7703d8713d0d38d4a4e52f94757ac5
1 #include <stdio.h>
2 #include <stdlib.h>
4 main()
6 int point, x, y;
8 point = x = y = -1;
9 sscanf("0x10 10", "%x %x", &x, &y);
10 printf("%d %d\n", x, y);
11 if (x != 0x10 || y != 0x10)
12 abort ();
13 point = x = y = -1;
14 sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y);
15 printf("%d %d %d\n", point, x, y);
16 if (point != 0 || x != 1234 || y != 9876)
17 abort ();
18 point = x = y = -1;
19 sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y);
20 printf("%d %d %d\n", point, x, y);
21 if (point != 1 || x != 1234 || y != 9876)
22 abort ();
23 return 0;