Hi. I'm having some troubles trying to convert my date from this format (ex.) 2/2/2015 into February 2, 2015. I'm suppose to change the month 2 into its month name from the enumeration. Is it right to use array to input the month, day, and year?
#include <iostream>
using namespace std;
enum monthType {JANUARY = 1, FEBRUARY, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER};
int main()
{
monthType monthName;
char month[2], day[2], year[5];
cout<<"Enter the date (mm/dd/yyyy): ";
cin.get(month, '/');
cin.get(day, '/');
cin.get(year, 5);
Enumeration are just a good way of using named constants instead of nondescript numbers. They are not names or something, nor they exist in compiled code.