C++ getline() problem for help

来源: 2006-07-13 10:08:32 [旧帖] [给我悄悄话] 本文已被阅读:

hi there
i am doing a project to read the data from a file and store to a array
data file is 1.txt is like froming
123
456
789

my code is like following

char myarray[3][3] ;
ifstream fin;
fin.open("hard-coded.txt");
if( !fin ) {
cerr return 0;
}
for(int x=0;x fin.getline(myarray[x],3,'/n');

but it always give me error message tat i don't know how to fix
can someone help me

thank you