When we create an application today,ProgramWe need to generate a random number and use time (0) to set the starting point of the random number. We found that wince has time. h: This header file, but it prompts that the time function is an unrecognizable symbol. Google, we found that there was no time function implementation in Lib, so...
Provides a time simulation function.CodeAs follows:
Time_t mytime (time_t
*
Intt)
{
Systemtime using imestruct;
Filetime ftime;
Ularge_integer int64time;
Time_t loctt
=
0
;
If (intt = null)
intt = & loctt;
Getsystemtime (&Systimestruct );
If (Systemtimetofiletime ( & Systimestruct, & Ftime ))
{
Memcpy ( & Int64time, & Ftime, Sizeof (Filetime ));
/* Subtract the value for (UTC) */
Int64time. quadpart -= 0x19db1ded53e8000 ;
/* Convert to seconds. */
Int64time. quadpart /= 10000000 ;
* Intt = Int64time. quadpart;
}
Return * Intt;
}