Hey guys! I've looked all over google and I can't figure out how to do this. I want to know how I can implement formatted strings into functions. You know how you can use fprintf() to create special strings with integers and stuff mixed in? I basically want to do the same thing. So for example, let's say I want a function that takes a formatted string and simply returns it. I know I'd have to start out like this:
1 2 3 4
char *Fstring(constchar *format, ...)
{
//empty
}
But what do I put inside the brackets? =?
I'd love it if anyone could help me with this. Thanks in advance.
Ok so basically, I'm using a game engine and it has a function called openUrl(const char* URL) that opens URL in your default browser. However, I want to rewrite it so that you could do something like openUrl("www.%s.com", "cplusplus");