Hey Com!
jede einzelne data[counter][x] Zeile wirft zuerst eine writing access violation und danach mehrere reading access violations ..
da es ein dynamisches array ist, muss ich (meines wissens nach) malloc() verwenden, doch wie genau wende ich das hier an? :o
danke im voraus
Code:
int main()
{
float data[6515][7] = { 0 };
FILE *CSV;
int d, m, y;
float Date, Open, High, Low, Close, Volume, Adj_Close;
CSV = fopen("dax.csv", "r");
int counter = 0;
if (CSV) {
while ((fscanf_s(CSV, "%d-%d-%d,%f,%f,%f,%f,%f,%f\n", &y, &m, &d, &Open, &High, &Low, &Close, &Volume, &Adj_Close)) != EOF)
{
data[counter][0] = (float)calcSeconds(y, m, d);
data[counter][1] = Open;
data[counter][2] = High;
data[counter][3] = Low;
data[counter][4] = Close;
data[counter][5] = Volume;
data[counter][6] = Adj_Close;
counter++;
}
}
const int rowCount = counter;
print_data(rowCount, data);
getchar();
return 0;
}
da es ein dynamisches array ist, muss ich (meines wissens nach) malloc() verwenden, doch wie genau wende ich das hier an? :o
danke im voraus