how to subtract two dates to find no of days .
animesh
0
Newbie Poster
Recommended Answers
Jump to Posti think that you can use
enum
it is as
structure
but enum list the elements by index as array .. for example
enum days_of_the_week ={sat,sun,mon,tue,wed,thu,fri };
there for .. sat has the value 0 and sun = …
Jump to PostThis is one way.
[b]#include[/b] <iostream> [b]#include[/b] <ctime> [b]int[/b] [b]main[/b]() { [b] struct[/b] std::tm a = {0,0,0,24,5,104}; /* June 24, 2004 */ [b] struct[/b] std::tm b = {0,0,0,5,6,104}; /* July 5, 2004 */ std::time_t x = std::[b]mktime[/b](&a); std::time_t y = std::[b]mktime[/b](&b); [b] if [/b]( x != (std::time_t)(-1) …
All 5 Replies
meabed
37
Junior Poster
Team Colleague
Dave Sinkula
2,398
long time no c
Team Colleague
LG915
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
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.