Date input validation

struct Inventory
{
char date[CAT_SIZE];
};
cout << "Date Added To Inventory: ";
cin >> Info.date;
How do I display the date as mm/dd/yy.


According to one of the forum, it has to do with this:
1. Find first instance of "/" character. If not found, date is not valid and exit
2. Get the substring from 0 to position of "/" as month_string, and the rest as rest_string.
3. Try to convert month_string to an integer month, and check if 1<=month<=12. If any is wrong, your date is invalid and exit.
4. Get the rest_string, find "/". If not found, date is invalid
5. Get day and year strings, similar to month string.
6. If year is not between 0 and 99 date is invalid
7. If day<1 date is invalid
8. Do a switch by month to get the upper limit on days. Remember, February has 28 days, unless ((year%4 ==0) && (year>0))


Please lead me start it.
Starts with: while((strcmp(stock.date, "/")==0) ?
Topic archived. No new replies allowed.