hi again
can u tell me how can i call the date function in "c"?
lonely_girl 9 Light Poster
Recommended Answers
Jump to PostThere's no "date" function in C. Be more specific or don't be surprised when nobody answers your question.
Jump to Posthttp://www.cplusplus.com/reference/clibrary/ctime/
Here's an unrelated example to get you started:
#include <stdio.h> #include <time.h> const char *suffix ( int thing ) { switch ( thing ) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; default: return "th"; } } …
Jump to PostYou can use a tm structure for the date of birth, convert it with mktime(), and subtract that from time(). Then convert your answer back into a tm struct.
All 11 Replies
Narue 5,707 Bad Cop Team Colleague
lonely_girl 9 Light Poster
mad93 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
lonely_girl 9 Light Poster
death_oclock 103 Posting Whiz
csurfer 422 Posting Pro
lonely_girl 9 Light Poster
death_oclock 103 Posting Whiz
lonely_girl 9 Light Poster
csurfer 422 Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.