|
There are several other ways to pass input a date in function. There are also structures for date time in C/C++, and doing mathematics with them is easy. Still If you want to continue with the date input as string in functions then you have to carry on the following steps
1. loop through date string until '\' is encountered and save it to another string say s_day chracter by chracter. When \ set null at end.
2. Convert it into an interger by using atoi() function.
3. Similary continue scaning the string and putting month and year in seperate strings and converting them to integers. Now do mathematics with them and convert them again insto string
|