If you are on Linux or some other system such as UNIX, you can use $to specify the argument number:
printf("%1$s%1$s\n", "hello");
In this example, 1$means "use the first argument". We also use this syntax several times, so this argument can be used once.
Linux man page forprintf gives more details:
( ) . '*' ( , ). , , , "% m $" '%' "m $" '', m , 1. ,
printf("%*d", width, num);
printf("%2$*1$d", width, num);
. . C99 , '$', Single UNIX. '$' , , , "%%", . , '$'; , 1 3, 2 - .