Thread: calling ...
View Single Post
Re: calling ...
Old
  (#7)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: calling ... - 16-02-2005

Else you can use varargs and concatenate all your szFmt into one single string, that you'll feed to f2 this way. I had the same problem once and that's how I did it.

*edit*

code always help
Code:
int function1 (const char *fmt, ...)
{
   va_list argptr;
   string temp_string[256];

   // concatenate all the arguments in one string
   va_start (argptr, fmt);
   vsprintf (temp_string, fmt, argptr);
   va_end (argptr);
 
   // call f2
   function2 (temp_string);
}



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 16-02-2005 at 00:33..
  
Reply With Quote