Contact Management Tool question


I'm just about to write a Contact Management Tool program for me, myself and I.
It's basically a contact list where I keep track of people, their number, email, date of birth, etc.

QUESTION: How to get the time?
Which function would suit my needs best?

I don't want to "upgrade" and modify the date everyday of course, I'd like my app. to be able to know what day it is and upgrade things like "age" without me having to input anything.

Basically, today is the 26th of Jan 2013 and I was born on the 14th of Nov 1991, I want my app. to know keep track of days and remind me people-birthdays every day of the year as I fire up the program.


EDIT: I know how to write and read from a file but I don know how to go about this time thing in detail.. any help would be much appreciated XD
Last edited on
You may use functions included in <time.h>

You basically need to store all dates in a time_t datatype. Then you can get current time at runtime and compare it to stored value. There is also this datatype; struct tm that you can use to easily convert between human and computer readable formats, eg. to take input of day month and year individually.

struct tm

thank you mate,

I have to decide how to go about this in a bit more detail and then design the implementations. again,Thank you very much
closed account (3qX21hU5)
Also if your looking to have it in a full GUI I can also reccomend using QT4 to do it. QT Creator has a drag and drop design tool that you can use when you are just starting out with GUI's and you can also program in C++ for the stuff that needs more detail then the drag and drop can provide.
thank you very much mate.
Actually, I have been working on "ChiliTomatoNoodle" tutorials on YouTube (you should check them out, they are amazing) and therefore I am working with a framework and I am "used" to make things from scratch. I made video games with menus and that was all from scratch. BUT, since i am not an expert and you probably know a lot more than me, would you advice me use QT4 anyway to speed up the programming process so that i save myself sometime coding stuff that are already there for me?
Topic archived. No new replies allowed.