-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
guys,
thanks for all the responses (",). i was just trying to port an old
program i did in vc++/turbo c. it converted the decimal to binary/hex.
it used the following format: itoa(num, buffer, base). the buffer string
outputs the value converted. i guess, it isn't possible w/ gcc. Thanks
anyway!Ron Michael Khu wrote: | u can use sprintf( str, "%d", integer ); | | [EMAIL PROTECTED] wrote: | |> On Tue, Jul 27, 2004 at 12:33:33PM +0800, Rebs Guarina wrote: |> |>> -----BEGIN PGP SIGNED MESSAGE----- |>> Hash: SHA1 |>> |>> hi guys, |>> |>> is there an equivalent for the function itoa (which converts an integer |>> to string) in gcc? |> |> |> |> snprintf(str, length, "%d", integer); |> |> should do the trick. Make sure that you give snprintf the right length, |> to prevent buffer overflows, which itoa is notoriously vulnerable to. |> | | | | -- | Philippine Linux Users' Group (PLUG) Mailing List | [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) | Official Website: http://plug.linux.org.ph | Searchable Archives: http://marc.free.net.ph | . | To leave, go to http://lists.q-linux.com/mailman/listinfo/plug | . | Are you a Linux newbie? To join the newbie list, go to | http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
- -- "I'm always a newbie. I wouldn't learn a damn thing if I were not." -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFBBgtJH28iJoWp+T4RAmCCAJ9/20uH08D98FEJbMrPo/FtuUjgugCdHTES 0jf2y5d4cGyvpKAm4TiaZq4= =caY4 -----END PGP SIGNATURE----- -- Philippine Linux Users' Group (PLUG) Mailing List [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
