Re: Float to String



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!

.



Relevant Pages

  • Re: Float to String
    ... the sprintf() hint was all that I needed ... after searching about that I found out that asprintfis much ... But is asprintf standard? ...
    (comp.lang.c)
  • ISA 2000 on SBS2003
    ... In the eventlog i get error 20002. ... Searching the usenet i found the hint there could be a problem with socket ...
    (microsoft.public.windows.server.sbs)
  • Re: Does the Nvidia "Nforce3 Ultra 250 pro" chipset work with FreeBSD AMD64 ?
    ... > Nvidias web only has Nforce3 drivers for ms-windows and linux. ... Did you try http://groups.google.com/ and then searching this list's ... (Hint, if you had you'd have found the answer you're looking for) ...
    (comp.unix.bsd.freebsd.misc)
  • Re: ioctl Socket question
    ... of declaration:( ... Hint: start searching in sys\cdefs.h. ... Like I said I'm not up with all the C preprocessor gobble-de-goop. ...
    (comp.os.os2.programmer.misc)
  • Re: iptables - Open all ports between 3 ips
    ... Gerhard Haslberger écrivait ... im searching and searching.... ... Can someone give me a hint? ... ips) but just between them. ...
    (comp.os.linux.networking)