Click here to Skip to main content
15,900,973 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Calculating Age in days Pin
cmk20-Feb-07 8:02
cmk20-Feb-07 8:02 
If it's worth doing, it's worth doing right.
Don't use an approx. daysInYear.

Caclulate the Julian day for the current day and the birth date.
Subtract one from the other to get age in days.

See:
http://en.wikipedia.org/wiki/Julian_day[^]
(calculating the JD from YMD is 4 lines of code, no excuse not to use it)


...cmk

Save the whales - collect the whole set

QuestionBetter HEX to INT conversion Pin
Llasus18-Feb-07 14:33
Llasus18-Feb-07 14:33 
AnswerRe: Better HEX to INT conversion Pin
Chris Losinger18-Feb-07 15:26
professionalChris Losinger18-Feb-07 15:26 
GeneralRe: Better HEX to INT conversion Pin
Llasus18-Feb-07 15:56
Llasus18-Feb-07 15:56 
QuestionWallpaper changer in MFC Pin
kubapl1818-Feb-07 9:07
kubapl1818-Feb-07 9:07 
AnswerRe: Wallpaper changer in MFC Pin
Mark Salsbery18-Feb-07 10:01
Mark Salsbery18-Feb-07 10:01 
AnswerRe: Wallpaper changer in MFC Pin
Rick York18-Feb-07 11:32
mveRick York18-Feb-07 11:32 
QuestionProblem with SetRect Pin
CoffeeAddict1918-Feb-07 8:45
CoffeeAddict1918-Feb-07 8:45 
AnswerRe: Problem with SetRect Pin
Mark Salsbery18-Feb-07 8:58
Mark Salsbery18-Feb-07 8:58 
GeneralRe: Problem with SetRect Pin
CoffeeAddict1918-Feb-07 9:11
CoffeeAddict1918-Feb-07 9:11 
GeneralRe: Problem with SetRect Pin
Mark Salsbery18-Feb-07 9:22
Mark Salsbery18-Feb-07 9:22 
GeneralRe: Problem with SetRect Pin
CoffeeAddict1918-Feb-07 9:38
CoffeeAddict1918-Feb-07 9:38 
GeneralRe: Problem with SetRect Pin
Mark Salsbery18-Feb-07 9:44
Mark Salsbery18-Feb-07 9:44 
QuestionVirtual Midi Output Port... Pin
aquawicket18-Feb-07 3:54
aquawicket18-Feb-07 3:54 
GeneralVC++ linker error Pin
Member 384040618-Feb-07 3:42
Member 384040618-Feb-07 3:42 
GeneralRe: VC++ linker error Pin
Waldermort18-Feb-07 3:47
Waldermort18-Feb-07 3:47 
GeneralRe: VC++ linker error Pin
Hamid_RT18-Feb-07 6:25
Hamid_RT18-Feb-07 6:25 
GeneralRe: VC++ linker error Pin
Hamid_RT18-Feb-07 4:55
Hamid_RT18-Feb-07 4:55 
GeneralRe: VC++ linker error Pin
Jeffrey Walton18-Feb-07 5:44
Jeffrey Walton18-Feb-07 5:44 
GeneralRe: VC++ linker error Pin
cruppstahl18-Feb-07 7:35
cruppstahl18-Feb-07 7:35 
NewsCode Snippets Manager Pin
marvviki18-Feb-07 2:42
marvviki18-Feb-07 2:42 
Questionmemory mapped I/O and private copies Pin
cruppstahl18-Feb-07 2:28
cruppstahl18-Feb-07 2:28 
AnswerRe: memory mapped I/O and private copies Pin
Waldermort18-Feb-07 3:17
Waldermort18-Feb-07 3:17 
GeneralRe: memory mapped I/O and private copies Pin
cruppstahl18-Feb-07 7:23
cruppstahl18-Feb-07 7:23 
QuestionHow to load text file into an array of structures..? [modified] Pin
Software_Specialist18-Feb-07 2:06
Software_Specialist18-Feb-07 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.