vsprintf

String.Format for C++

Looking for an implementation for C++ of a function like .NET's String.Format. Obviously there is printf and it's varieties, but I'm looking for something that is positional as in: String.Format("Hi there {0}. You are {1} years old. How does it feel to be {1}?", name, age); This is needed because we're going to try and make ...

Mac OS X port crashes in pthread_setspecific in glibstdc++ vsnprintf - how to troubleshoot?

I'm testing a Mac OS X port of my multithreaded server. It starts up, but it dies in vsnprintf soon after the first client request is taken by a worker thread. It seems that vsnprintf is trying to manipulate some thread local memory with pthread_setspecific. This dereferences a bad pointer. Then, gdb traps a dlopen call, gets an error,...

How to check that vsprintf has the correct number of arguments before running.

I'm trying to use vsprintf() to output a formatted string, but I need to validate that I have the correct number of arguments before running it to prevent "Too few arguments" errors. In essence I think what I need is a regex to count the number of type specifiers, but I'm pretty useless when it comes to regex and I couldn't fund it anyw...

Is it possible to use the sprintf() function in XSLT?

I'd like to do something like "Hello %s" and have "World" in another variable. Of course I could do this simple case using string replacement but if possible I'd like all sprintf() features like argument reordering, which would be very complex to do myself. ...

PHP sprintf escaping %

I want the following output:- About to deduct 50% of € 27.59 from your Top-Up account. when I do something like this:- $variablesArray[0] = '€'; $variablesArray[1] = 27.59; $stringWithVariables = 'About to deduct 50% of %s %s from your Top-Up account.'; echo vsprintf($stringWithVariables, $variablesArray); But it gives me this erro...