Re: need of a sprintf like function...
- From: Thad Smith <ThadSmith@xxxxxxx>
- Date: Mon, 31 Oct 2005 07:22:24 -0700
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
.
- Follow-Ups:
- Re: need of a sprintf like function...
- From: Simon Biber
- Re: need of a sprintf like function...
- Prev by Date: Re: Can you recommend any C programming books?
- Next by Date: Re: Why this code is working
- Previous by thread: Re: Can you recommend any C programming books?
- Next by thread: Re: need of a sprintf like function...
- Index(es):
Relevant Pages
|