double* DataOpen::readData(char* dataName)
{
FILE *file;
double* textData;
textData =(double*)malloc(sizeof(double)*3);
file = fopen(dataName, "r");
int k, countIdx = 0;
while(fscanf(file, "%d", &k) > 0){
textData[countIdx] = k;
countIdx++;
}
textData =(double*)realloc(textData,sizeof(double)*countIdx);
fclose(file);
return textData;
}
반응형