Answer the question
In order to leave comments, you need to log in
Is there a sprintf with an array of format options?
I want something strange...
There is a string like "Something: %s, anything: %d, different: %0.2f", which is obtained from the outside (i.e. the number of format arguments is unknown) and the corresponding size (and types) "array " values to be substituted in the appropriate places.
You need to do "sprintf".
As long as it comes to mind
sprintf(buf, fmt, par[0], par[1], par[2], par[3], par[4], и так далее до X, а если мало, то до Y);
Answer the question
In order to leave comments, you need to log in
There is a string like "Something: %s, anything: %d, miscellaneous: %0.2f", which is obtained from the outside (i.e. the number of format arguments is unknown)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question