Is it possible to change the order of parameters to sprintf?
like sprintf(" this is %arg[2] test %arg[1]" , arg1, arg2)
I need to dynamically change the order of the arguments so is that possible with sprintf?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes.
The format is
%N$fmtwhere N indicates the ordinal position of the argument, andfmtis what you would put after the%sign when usingsprintfnormally.