TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: NUNO FILIPE
from: WAYNE SCHROEDER
date: 1997-06-14 13:37:00
subject: C++ - Copy a text file t

NF>     Note: The variable is char, and is declared as "matrix[3][25]".
NF>       Can someone help me please??? Thanks.
NF>       Ps- I have Borland C++ 2.0
first... matrix[3][30] - 25 was not enough.. and they go 0...2, 0...29
// MAXROW will be how many lines in file
// MAXCOL will be the max line length
#include 
#include 
#include 
const int MAXROW=3,MAXCOL=30;
char matrix[MAXROW][MAXCOL];
void main(){
ifstream inFile("C:\\ta");
if (inFile.good()) {          // test if it was opened!
     for(int i=0;i<3;i++){
          inFile.getline(matrix[i],30,'\n');
     }
} else
     cout << "BAD FILE\n";
return;
}
// have tested it.. it works great.
...
þ CmpQwk #UNREGþ UNREGISTERED EVALUATION COPY
--- FMail/386 1.22
---------------
* Origin: =(Mental Floss)=(913-383-2925)= (1:280/191)

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