I am writing a program that allows a user to login and logout. What I want to do is to keep track how long they were logged in for. I have read http://www.cplusplus.com/reference/clibrary/ctime/difftime/, but I don't know how to implement it into my program. Should I create a function or something?
From what I can tell you're doing (for future reference we prefer as much detail as you can give us without voiding any contracts you may be bound to) the answer is that "difftime" <i>is</i> a function, it returns a value in seconds that you may want to convert to minutes or do what ever with. How do you want to display the data?