On Tue, 27 Jul 2004, Rebs Guarina wrote:
..
> 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!

RTFM.
To do what you want, for hex:

sprintf(buffer, "%x", num);

for octal, change the format string to %o

binary is not supported in such a straightforward fashion.


---
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.

--
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

Reply via email to