//ic210 section 4002 //20 nov 2009 /******************************************************** This program simply reads in a date in mm/dd/yyyy format and prints it back in dd monthname yyyy format. Since I want to hardcode the month names into the program, a static array is the natural way to go. *********************************************************/ #include #include using namespace std; int main() { int day, month, year; char junk; cin >> month >> junk >> day >> junk >> year; string months[12] = {"January", "Febuary", "March", "April", "May","June","July", "August", "September", "October", "November","December"}; //Even if we have a statically defined array, //we can treat it as any other array //so we can change the value of any cell //static array means that the memory for the array is allocated //when the array is declared, just the same as for int, double variables //months[0] = "jan"; cout << day << " " << months[month-1] << " " << year; }