2
Good, I’m having some trouble separating the date parts through bitwise operations.
date format: yyyy-dd-mm
int menor_data(int date1, int date2)
{
int day1 = (date1 >> 8) & 0xff;
int month1 = date1 & 0xff;
int year1 = (date1 >> 16) & 0xff;
int day2 = (date2 >> 8) & 0xff;
int month2 = date2 & 0xff;
int year2 = (date2 >> 16) & 0xff;
}
The problem is that when I print for example Year1 has nothing to do with the date year 1. I think I’m making a mess because the dates are based on 10 and the mask is based on 16
Please show a full example that includes the entries you pass to the function
menor_data
(beyond the result obtained and the expected)– hugomg