#include "csvRead.h"
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
csvRead::csvRead(char *Book1)
{
string fData;
this->name = name;
this->score = score;
this->f>
fileRead(fData, Book1);
getData(fData);
for(int i = 0; i<15; i++)
{
for (int j = 0; j<7; j++)
{
cout << Pdata[j][i] << " ";
}
}
cout << endl;
}
void csvRead::fileRead(string &fData, char *Book1)
{
ifstream fin(Book1);
if (!fin)
{
cout << "열기오류" << endl;
exit(1);
}
while (true)
{
string buf;
getline(fin, buf);
if (fin.eof()) break;
f + buf + '\n';
}
fin.close();
}
void csvRead::getData(string fData)
{
int a = 0;
int b = 0;
int c = 0;
string temp1;
for (int i = 0; i<15; i++)
{
for (int j = 0; j<7; j++)
{
b = fData.find(",", a);
temp1 = fData.substr(a, b - a);
Pdata[j][i] = temp1;
a = b + 1;
}
}
}
메인에서 생성자를 읽어서 출력시키면 왜
왜 저따위로 쓸모없는게 맨밑에 쳐 튀어나옵니까요?
그냥 구글 검색해.. 수백만건 나올거다..
난 라이브러리 써서 그냥 호출하는데