Below is a small example of what I think you're trying to accomplish. You could also get the year dynamically if you want from Windows API. Keep in mind this isn't very accurate, you would have to take into account down to the day if you want to truly be accurate.
1 2 3 4 5 6 7 8 9 10 11 12
#define CurrentYear 2011
int main()
{
int iYear = 2011;
std::cout << "Enter the year you were born." << std::endl;
std::cin >> iYear;
std::cout << "You are " << CurrentYear - iYear << "years old."return 0;
}