[aclug-L] Re: C question or Sometimes it's the simplest things...
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Look up the 'ltoa' function. The third paramater is radix, '2' for
binary. The first paramater is the 'long value' to be converted.
The second parameter is a pointer to a 'char buffer' big enough to
hold the conversion + a 'C' end-of-line. Better to be big on this
buffer than 1 char to small.
On Fri, 5 May 2000, Larry Bottorff wrote:
> I need to take an int and convert it to store/display as a binary
> string. That is, if I have 35 in need to store it as the char array
> 100011. Is there some simple function I'm not aware of?
> Larry Bottorff
> -- This is the discussion@xxxxxxxxx list. To unsubscribe,
> visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
-- This is the discussion@xxxxxxxxx list. To unsubscribe,