Converting floats to ascii and vice versa
Ted Nolan
ted at usceast.UUCP
Wed May 2 02:28:47 AEST 1984
<1 = 0.99999999>
There are several ways to convert floats to ascii and vice versa.
The query asked specifically (sp?) for functions like atoi and itoa.
Our version 7 system has an atof(3) function available, which is
like atoi for floats. If this is not present K&R give an atof
function on page 69 of the C book .
However, I find that the string formatting commands sprintf and
sscanf give a much nicer and more general way to do this type of
conversion
--
--------------------------------------------------------------------------------
Ted Nolan usceast!ted
6536 Brookside Circle
Columbia, SC 29206 (feather the rast!)
--------------------------------------------------------------------------------
More information about the Comp.unix
mailing list