thank you I learned new thing from you today.
the probelm now is that I would like the user to inter the dirctory of the input file and the output file is this possible if yes, please tell me how to do it, I do not have any idea.
part of my program is
Code:
if ( foo(-1, "C:\\Wadi\\In\\Log_%d.csv", filename, sizeof filename) ) //this function to bring file according the day number.
{
ifstream input_file(filename); // the I opened that file
if(!input_file.is_open())
{
return 1;
}
else// do calculation
{.............}
and have
if( strcmp( filename, "C:\\Wadi\\In\\Log_01.csv" ) == 0 ) // to check if the input file ( day 1) to open new out put file
{
sprintf (buffer, "C:\\Wadi\\Out\\Daily_Summary_%d.csv", month); // new out put file for the new month
ofstream outfile(buffer, ios::out | ios::app);
outfile << sums[i]/count<<"," << max[i]<<","<< min[i]<<",";
......}
any way all this is not a problem( I do not use Ms-dos window ) I stopped that window
Code:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
I do not needed because I reading from a file and get the result in the out file.
by the way I run my program daily to make a summary report, I made that using Window xp task scheduler.
again my probelm is that I am going to give my project to some people to run it in their computer , so they would like to spacify the path of the input file and the outfile themself.
so as I do not have any idea how to do that, I seeked your help.