You're pretty much going to have to write your own. I'm assuming you're going to do something like:
Code:
./progname "foo %s bar %d" "hello" 20
And have it output:
You're going to have to roll your own. Which means, you're going to have to parse the first argument, and tokenize it up into chunks, then output them one at a time. Like so:
Code:
foo <snip out token, replace with next argument> bar <snip out token, replace with next argument>
Which, if all you're doing is outputting it, is very easy, because all of your command line arguments are already strings. So you just chop the token, and strcat the next argument. Then repeat. Just throw it in a parsing loop.
Code:
while character[ x ] in first argument isn't null
if this is a 'token'
strcat the next argument (kept track of with counter) onto this string
else
copy this character onto the output string
Really easy.
If you need more than that, that is to say, if you need that 20 to be a decimal 20 for something other than just outputting text, you'll need to read the secondary token, (like the d that follows the % sign) to see what function you need to call. For example, we might use a switch to drop down with the 'd' as our switch argument, wich tells us we need to call something like atoi on that argument.
Code:
switch( secondarytoken )
{
case 'd': somevar = atoi( argv[ somecounter++ ] ); break;
case 's': strcpy( somebuffer, argv[ somecounter++ ] ); break;
...
}
Quzah.