TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NUNO FILIPE
from: KEVIN CAMPBELL
date: 1997-06-18 08:24:00
subject: C++ - Copy a text file to an `array`.

 > Hello!
 > I want to do a program in c++ that analyse, some text files (logs for
 > example) but I'm having a problem doing this:
 > I want to Copy one text file to a bi-dimention variable, so that one
 > line
 > from an text file will be one line of the variable.
Use fgets(); and pass it the name of the array you want to copy the data 
into. You're probably best using a Large buffer (if the log-file has 
multi-sized lines) and then using a strcpy() or a memcpy() to move the data 
from the buffer into the array.
Have Fun - Kev
Kevin Campbell
Sysop of Deimos BBS
E-Mail: Sysop@Deimos.unmanned.co.uk
--- FMail/386 1.02
---------------
* Origin: Mail shipped from Deimos Spaceport (2:259/17)

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