I'm fairly new to using structs so bare with me. From what i've read this seems ok, but when it's run it says there is an error with the struct.Code:#include <iostream> using namespace std; int main() { int index; struct DOB{ int day; int month; int year; }; DOB date[9]; for (index = 0; index < 1; index ++) { cout << endl << "please enter the day "; cin >> date[index].day; cout << endl << "please enter the month "; cin >> date[index].month; cout << endl << "please enter the year "; cin >> date[index].year; } cout << date[1]; }
I realise the values of the array are wrong at the moment but that's just until I get the actual code working.
Can anybody help me?
Thanks.