Backpropagation c++ code

main()
{
OutputTrain = fopen("OUTTRAIN.txt", "w"); // buka paparan data output sasaran


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.

BallonMSE.obj - 12 error(s), 0 warning(s)
Last edited on
Please use [code][/code] tags and standard C++. Also, what headers are you #including?
See http://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#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 
Topic archived. No new replies allowed.