Hello i'm having some problem to finish this assignment. The assigment is "Create a program that an user will input his birthday date in the following format dd / mm/yyyy and the program will retreive the computer local time in order to calculate the user's birthday! the year of birth is not exclusive to the operation use the the day and month to calculate!" (HINT: think about the time in secconds!!!)"
#include <iostream>
#include <ctime>
usingnamespace std;
time_t dateToTimeT(int month, int day, int year) {
tm tmp = tm( );
tmp.tm_mday = day;
tmp.tm_mon = month - 1;
tmp.tm_year = year - 1900;
return mktime(&tmp);
};
struct user
{char ps.name;
int ps.dtBirth;};
struct Compare
{int cmp.dt;};
int main()
{
time_t date1 = dateToTimeT(%4Y,%4m,%4d);// i get error saying that is not defined how to i solve this???
cout<<"write your name\n";
cin.get(ps.name,50);
cout<<"write the date of birth (dd mm yyyy)\n";
cin>>ps.dtBirth.day>>ps.dtBirth.mon >>ps.dtBirth.year;
//Current date/time based on current system
cout<< "Today is: "<<date1;
system ("pause");
return 0;
}