1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include "predefine.h"
using namespace std;
int main()
{
DOCUMENT doc[MAX_DOCUMENT];
char line[256];
int i=0;
ifstream doc_file("Documents.csv",ios::in);
while(doc_file.good())
{
doc_file.getline(line,256,',');
strcpy(doc[i].IDDoc,line);
doc_file.getline(line,256,',');
strcpy(doc[i].ISBN,line);
doc_file.getline(line,256,',');
strcpy(doc[i].title,line);
doc_file.getline(line,256,',');
strcpy(doc[i].author,line);
doc_file.getline(line,256,'\n');
strcpy(doc[i].year,line);
i++;
}
doc_file.close();
}
|