TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: Roger Scudder
date: 1998-03-05 00:00:00
subject: HELLLLLLLLLLLLLLLLLLLLLP

From: Roger Scudder 
Subject: HELLLLLLLLLLLLLLLLLLLLLP
Date: 1998/03/05
Message-ID: #1/1
References: 
Distribution: fido
Organization: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
Newsgroups: fido.c_plusplus


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.

SOURCE: echoes via archive.org

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