SCAN ("12345", "%ld", N); SCAN ("12345", "%llllld", N); SCAN ("12345", "%LLLLLd", N); SCAN ("test ", "%*s%n",  n); SCAN ("test ",   "%2*s%n",  n); SCAN ("12 ",   "%l2d",  n); SCAN ("12 ",   "%2ld",  N);
SCAN ("12345", "%ld", N, 1, 12345); SCAN ("12345", "%llllld", N, 0, -1); SCAN ("12345", "%LLLLLd", N, 0, -1); SCAN ("test ", "%*s%n",  n, 0, 4); SCAN ("test ",   "%2*s%n",  n, 0, -1); SCAN ("12 ",   "%l2d",  n, 0, -1); SCAN ("12 ",   "%2ld",  N, 1, 12);  return result;
t2 (){  int n;  long N;  int retval;#define SCAN(INPUT, FORMAT, VAR) \  VAR = -1; \  retval = sscanf (INPUT, FORMAT,  &VAR); \  printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \	  INPUT, FORMAT, retval, VAR);  SCAN ("12345", "%ld", N);  SCAN ("12345", "%llllld", N);  SCAN ("12345", "%LLLLLd", N);  SCAN ("test ", "%*s%n",  n);  SCAN ("test ",   "%2*s%n",  n);  SCAN ("12 ",   "%l2d",  n);  SCAN ("12 ",   "%2ld",  N);}