How to count days between two dates. Dates ar hold in integer variables (array). If there is some function would be great. If no, I have trying something with for loops, but didn't found right algorithm.
#include <iostream>
int stoi(std::string s);
int main(){
/* 5th november of 2013 */
int days1[0] = 05;
int days1[1] = 11;
int days1[2] = 2013;
/* 7th october of 2016 */
int days2[0] = 07;
int days2[1] = 10;
int days2[2] = 2016;
int days = date(days1,days2);
std::cout << days << std::endl;
return 0;
}
int date(int dates1[], int date2[]){
int days = 0;
/* Task: how much days is past */
/* Days in each month must be real (31 or 30 or 29/28) */
/* there can't be constant as 31 days on each month or 365 days in year */
return days;
}