Back to index

glibc  2.9
scanf7.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   long long int n;
00008   int ret;
00009 
00010   n = -1;
00011   ret = sscanf ("1000", "%lld", &n);
00012   printf ("%%lld: ret: %d, n: %Ld\n", ret, n);
00013   if (ret != 1 || n != 1000L)
00014     abort ();
00015 
00016   n = -2;
00017   ret = sscanf ("1000", "%llld", &n);
00018   printf ("%%llld: ret: %d, n: %Ld\n", ret, n);
00019   if (ret > 0 || n >= 0L)
00020     abort ();
00021 
00022   return 0;
00023 }