Hello Jabo.
04 Mar 98 17:03, Jabo wrote to All:
J> i save a digit lets say is 6542 to a file ( XXX.ext )
J> how would i read the digit in XXX.ext and +/- from it?
J> HELP!
J> i save it fprintf("fptr, %d", total);
J> i tried but it reads the contents of the file as a string!?
You can convert the string to int with atoi( ) or to long using atol().
That is one way to do it. Another way is to us a "binary file".
To do that you must open the file in binary mode. You can write
an int to a binary file with fwrite( ) and read it with fread( ).
-Roger
... I have a memory like a... I forgot what they call it.
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
|