Yes, i only care about hours and minutes. But how compare them. I try to compare for example given hour with timeinfo.tm_min (as you can see below text )
Code:
#include <stdio.h>
#include <time.h>
time_t rawtime;
struct tm * timeinfo;
int main(void)
{
int hour, min;
char buffer [80];
printf("Set the time of receiving procedure (like 12:00):");
scanf("%d:%d", &hour, & min);
printf("The time you print is %d:%d\n", hour, min);
time ( &rawtime );
timeinfo = localtime ( &rawtime );
strftime (buffer,80,"Now it's %H:%M.",timeinfo);
puts (buffer);
if (hour==timeinfo.tm_min)
{
// run function.
}
return 0;
}
but i received error in my compiler like below.
error #2113: Left operand of '.' has incompatible type 'struct tm *'.
I need to get current hour and current minute to valid value like int etc.Thanks in advance