Re: need of a sprintf like function...



ypjofficial@xxxxxxxxxxxxxx wrote:

if there any library function which can avoid allocating memory to str.
i.e i can write
char * str = NULL;
and directly pass str to that printf like function and the function
will internally handle the allocation of memory and releasing it.

Yes. The C99 function snprintf has a length parameter, which you may set to 0.


--
Thad

.



Relevant Pages