I currently use _snprintf(NULL,0,fmtStr, Str..)
and it returns the required size of the buffer. I allocate them and then invoke _snprintf
again to fill the buffer. But currently _snprintf
is deprecated and _snprintf_s
is the recommended function. But according to msdn it doesn't seem to return length without allocating buffer before-hand.
Is there a way around this?