How I can to create an interval between dates. I need a cin for the two interval and verify the temperature in the list, survey of occurrences of a given temperature in a period, showing how many times the temperature was greater than 25ºC.
My list insere in this order
I need to go through the list and compare the values of dataHora of list. My list is:
1 2 3 4 5 6 7 8 9 10 11 12 13
template<typename T>
void ListaEncadeada<T>::insereF(T x) { //Adiciona um elemento ao final da lista
Elemento<T> *novo = new Elemento<T>(x); // Aloca espaço de memória
tam++;
if (!cabeca) // Lista vazia
cabeca = novo;
else { // Lista já tem elementos
Elemento<T> *onde = cabeca;
while (onde->prox) // Enquanto não for o último elemento
onde = onde->prox;
onde->prox = novo;
}
}
Working with time is notoriously difficult. There are timezones to consider and daylight savings time and leap years and leap seconds, etc. The best way to compare two times is to convert the day/month/year/hours/minutes/seconds into the number of seconds from a specific point in time, and then compare the offsets.
The standard does not specify in what units time since epoch should be measured;
but it does guarantee that std::time_t is some arithmetic type.
Compare them like we would compare any arithmetic type (==, < etc.)