#include #include #define TRACE_1(chaine, formati, formato, indirection, parametre) \ n = sscanf(chaine, formati, indirection parametre); \ printf("\"%s\" & \"%s\" & [" formato "] & %d \\\\\n", \ chaine, formati, parametre, n) int main(void) { int n; char s[100]; int i; unsigned u; TRACE_1(" xy=abc ", "%s", "%s", , s); TRACE_1(" xy=abc ", "%3s", "%s", , s); TRACE_1(" xy = abc", "%3s" , "%s", , s); printf("\\hline\n"); TRACE_1(" xy= abc", "xy=%s", "%s", , s); TRACE_1(" xy= abc", " xy=%s", "%s", , s); TRACE_1(" xy= abc", " xy=%s", "%s", , s); TRACE_1(" x y= abc", " xy=%s", "%s", , s); TRACE_1(" xy= abc", " x y =%s", "%s", , s); printf("\\hline\n"); TRACE_1(" xy=abc ", "%[ =x]", "%s", , s); TRACE_1(" xy=abc ", "%*[ =x]%s", "%s", , s); TRACE_1(" xy=abc ", "%[=x]", "%s", , s); printf("\\hline\n"); TRACE_1(" xy= 333", " xy = %d", "%d", &, i); TRACE_1(" xy= 333", "%d", "%d", &, i); TRACE_1(" 012345 ", "%d", "%d", &, i); TRACE_1(" 012345 ", "%i", "%d", &, i); TRACE_1(" -1 ", "%d", "%d", &, i); TRACE_1(" -1 ", "%u", "%u", &, u); return EXIT_SUCCESS; }