Hi,
I'm trying to create a function that calculates the days left to the end of a subscription.
Example:
I have a function that registers a user in a program, and stores the subscription date in a structure.
Now, I want to create a function that calculates the days left for the end of his subsription.
SUBSCRIPTION DATE: 20-05-2007
SUBSCRIPTION ENDS IN: 30 DAYS
...
...
...
SUBSCRIPTION DATE: 20-05-2007
SUBSCRIPTION ENDS IN: 22 DAYS
I don't have any ideia on getting this to work :(
Can anyone help me on this?
Code:typedef struct
{
int day, month, year;
}Date;
Date actualDate()
{
Date h;
time_t a;
struct tm* b;
time (&a);
b=localtime(&a);
h.day = b->tm_mday;
h.month = b->tm_mon+1;
h.year = b->tm_year+1900;
return h;
}

