char a1[] = {'A', 'B', 'C'};
char a2[] = "world"; printf("[%.*s][%.*s]\n", , a1, , a2);
printf("[%.*s][%.*s]\n", sizeof(a1), a1, sizeof(a2), a2);
printf("[%-*d]\n", , 'A'); //产生"65 "
printf("[%-*s]\n", , "A"); //产生"A "
printf("[%#0*X]\n", , ); //产生"0X000080","#"产生0X
printf("[%*.*f]\n", , , 3.1415926); //产生" 3.14"
左补0
printf("[%0*s]\n", 4, "A"); //产生"000A"