Hello! First post so I'd like to say hello to everyone :)
So I've got this code here, I am very new to C++ and going through the basics, and I am creating a program that will tell the user when he/she is born. So the user puts his/her age in and I want to get the system year and just subtract it from the age, rather then having the user putting the year in.
The code I use is this:
#include <iostream>
#include <ctime>
using std::cout;
using std::endl;
int main()
{
char date[9];
_strdate(date);
cout << date << endl;
}
and it outputs for example; 28/08/2009. But I have absolutely no idea how to filter it so that it only gets the year and then to subtract it from what the user puts in.