Re: Float to String
- From: "YLD" <ruroma@xxxxxxxxx>
- Date: 10 Sep 2005 09:17:15 -0700
Thank you very much Emmanuel, the sprintf() hint was all that I needed
and of great help.
However, after searching about that I found out that asprintf() is much
safer, as you don't have to deal with how much space the destination
array needs. It is also very simple.
I post a sample code just in case anybody gets here looking for the
same information:
#include <stdio.h>
int main()
{
char *my_string;
asprintf (&my_string, "Being %d is cool, but being free is best of
all.", 4);
puts (my_string);
return 0;
}
Bye!
.
- Follow-Ups:
- Re: Float to String
- From: Barry Schwarz
- Re: Float to String
- From: Emmanuel Delahaye
- Re: Float to String
- From: Irrwahn Grausewitz
- Re: Float to String
- From: Emmanuel Delahaye
- Re: Float to String
- References:
- Float to String
- From: YLD
- Re: Float to String
- From: Emmanuel Delahaye
- Float to String
- Prev by Date: Re: structure member access issue
- Next by Date: Re: Floating Point Precision
- Previous by thread: Re: Float to String
- Next by thread: Re: Float to String
- Index(es):
Relevant Pages
|