TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JABO
from: ROGER SCUDDER
date: 1998-03-05 04:28:00
subject: HELLLLLLLLLLLLLLLLLLLLLP

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

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.