I have an assignment for my classes and do not understand how to separate a date format given to the user in a way such as mm/dd/yy properly so that the / is negated and it moves to the next number given. I have everything else working in my code, but am not able to figure this out. If someone could give me any advice or provide me with any information to help me with this, it would be greatly appreciated.
The code that I currently have for this portion is:
cout << "Enter date in the format mm/dd/yy: ";
cin >> month >> day >> year;
cout << endl;
cout << "Month is " << month << endl;
cout << "Day is " << day << endl;
cout << "Year is " << year << endl;
Note: I do not need help with anything else on the assignment right now, I am just trying to figure out how to separate these numbers properly. Thank you.
Please login or Register to submit your answer