#include #include using namespace std; struct month { int length; const char *name; }; int main() { const month a[] = { //C++ doesn't need the keyword struct here. {31, "January"}, {28, "February"}, {31, "March"}, {30, "April"}, {31, "May"}, {30, "June"}, {31, "July"}, {31, "August"}, {30, "September"}, {31, "October"}, {30, "November"}, {31, "December"} }; const size_t n = sizeof a / sizeof a[0]; for (size_t i = 0; i < n; ++i) { cout << a[i].length << "\t" << a[i].name << "\n"; } cout << "\n"; for (const month *p = a; p < a + n; ++p) { cout << p->length << "\t" << p->name << "\n"; } return EXIT_SUCCESS; }