printtime ();
// 30-08-2008
struct time t;
gettime(&t);
printf("Time is : %2d:%02d:%02d.%02d\n ",
t.ti_hour, t.ti_min, t.ti_sec, t.ti_hund);
first = t.ti_hund;
//31-08-08
// last time first = time(NULL);
learning();
recall();
printtime();
// last time second = time(NULL);
//31-0808
gettime(&t);
printf("Time is : %2d:%02d:%02d.%02d\n ",
t.ti_hour, t.ti_min, t.ti_sec, t.ti_hund);
second = t.ti_hund;
//31-08-08
fprintf(OutputTrain,"Processing time = %f",difftime(second,first));
fclose(OutputTrain);
return 0;
}
the following errors occur:
error C2079: 't' uses undefined struct 'time'
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(67) : error C2065: 'gettime' : undeclared identifier
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(69) : error C2228: left of '.ti_hour' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(69) : error C2228: left of '.ti_min' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(69) : error C2228: left of '.ti_sec' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(69) : error C2228: left of '.ti_hund' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(70) : error C2228: left of '.ti_hund' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(82) : error C2228: left of '.ti_hour' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(82) : error C2228: left of '.ti_min' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(82) : error C2228: left of '.ti_sec' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(82) : error C2228: left of '.ti_hund' must have class/struct/union type
c:\users\abubakar\desktop\msc. courses\puspa_final_experiments\balloon\1-mse\ballonmse.cpp(83) : error C2228: left of '.ti_hund' must have class/struct/union type
Error executing cl.exe.
#include <dos.h>
void main()
{
struct time t;
int Hour,Min,Sec,Hun;
gettime(&t);
Hour=t.ti_hour;
Min=t.ti_min;
Sec=t.ti_sec;
Hun=t.ti_hund;
printf("Start time is: %2d:%02d:%02d.%02d\n",
t.ti_hour, t.ti_min, t.ti_sec, t.ti_hund);
....
your code to time
...
// read the time here remove Hours and min if the time is in sec
gettime(&t);
printf("\nTid Hour:%d Min:%d Sec:%d Hundreds:%d\n",t.ti_hour-Hour,
t.ti_min-Min,t.ti_sec-Sec,t.ti_hund-Hun);
printf("\n\nAlt Ferdig Press a Key\n\n");
getch();
} // end main