jeudi 26 mars 2015

Adding time with structure construction in C

I've just started C, and I got task to add 1minute and 30sec to the entered date which consists of year month day hours minutes seconds. So, I've used struct construction as it is one of the requirements. However, everything looks good until the many cases I have to take care of. For example I have to change everything if the entered date is 2014/12/31 23:58:30 or 2014/2/28 23:59:00 .. The easiest way is to check it with if statements but I think there should be another way, instead of writing 123123 if statements, for every case I want to take care of. Could you please tell me if there is another clearer way of doing so. Thanks


Aucun commentaire:

Enregistrer un commentaire