Hi all,
i need to read a Tutorb.csv file but im having some problem to open it.
this is my sample code
Code:
/*********test.h**********/
.
.
A=Utils::GetMatrix("Tutorb.csv");/*i have placed Tutorb.csv in same directory of test.h(i.e Tutorb.csv is placed in same path of test.h),so there is no misplacing of Tutorb.csv file*/
cout<<A;
cout.flush();
.
.
Code:
/******utils.h*******/
.
.
static Array2D<REAL> GetMatrix(const char* filename)
{
char szLine[MAXLINE];
char seps[]=",";
FILE* fp=fopen(filename,"r");
if (fp==NULL)
{
printf("Failed to open data file");
return Array2D<REAL>(0,0);
}
//here are some code that reads the file
}
.
.
please guide me where i have went wrong.
waiting for your reply.