I have some kind of task to make a C program that compares two dates and returns how many days are in between.
The thing is, identifier for variables should be one from time.h library, so I can't use strings or integers for those 2 dates. I know there is time_t identifier for variables in time.h but how do I go on to ask user input for variable with that type? I don't know % what should I put in printf or scanf for this type. Also, is there some way I could check if user input is valid?
And to compare those two, I guess I should be using difftime() function that is also contained in time.h, but then again, I am not sure. I read somewhere it shows difference in seconds, not sure if that source is legit, but I don't really need that. I need days, since I am working with dates.
There is not much material about this online, that is why I am asking for help. Thanks in advance!