I need to write a function called printDate that takes a single record of the type Date as a parameter and returns nothing. The function should display the contents of the input record, using cout. I'm not sure how to do this because I don't understand how to create a function.
#include<iostream>
usingnamespace std;
struct printDate {
printDate(int d, int m, int y):
day(d),month(m),year(y){}
int day;
int month;
int year;
};
int main(){
printDate adate(25,11,2009);
cout<<adate.month<<'/'<<adate.day<<'/'<<adate.year<<endl;
return 0;
}