Re: sprintf with dynamic number of elements



"ljb" <lbayuk@xxxxxxxxxxxxxxx> wrote in message
news:T6Nah.3987$ql2.1212@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
netizen@xxxxxx wrote:
.oO(Bosconian)

I'm looking for a way to pass a dynamic number of args to sprintf.
[...]

http://www.php.net/vsprintf

As stated above, vsprintf() is the answer in this case. In other cases,
you can use call_user_func_array() if you need to pass a variable number
of
arguments to a function.

I totally missed vsprintf() *blush*

Leave it to the PHP developers for thinking of EVERYTHING.

Anyway, sorry for wasting your time. I had previously visited the sprintf()
page, but overlooked vsprintf() for whatever reason.


.



Relevant Pages

  • Re: Listing the most dangerous parts of C
    ... 8 C functions suffer from format string vulnerabilities ... printffprintfsprintf() snprintfvprintfvfprintfvsprintf() ... snprintf() is not a standard C function ...
    (comp.lang.c)
  • Re: New to VC7,8, port from VC6 error points to STL
    ... C2873: 'sprintf': symbol cannot be used in a using-declaration ... C2873: 'vsprintf': symbol cannot be used in a using-declaration ... using namespace std; ...
    (microsoft.public.vc.stl)
  • New to VC7,8, port from VC6 error points to STL
    ... C2873: 'sprintf': symbol cannot be used in a using-declaration ... C2873: 'vsprintf': symbol cannot be used in a using-declaration ... : error C3861: 'sprintf': identifier not found ...
    (microsoft.public.vc.stl)
  • Re: Why no gzvprintf in zlib?
    ... Because not all libraries provide vsprintf / vsnprintf. ... sprintf or snprintf. ... the STDC implementation of gzprintf depends ...
    (comp.compression)
  • Re: string format
    ... Well printf, fprintf, sprintf(), snprintf, vprintf, vfprintf(), ... vsprintf(), vsnprintf(). ...
    (microsoft.public.vc.stl)