Skip to main content

Timeline for Day counter between two dates

Current License: CC BY-SA 3.0

10 events
when toggle format what by license comment
May 23, 2017 at 12:40 history edited CommunityBot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Aug 29, 2013 at 20:21 history edited Jamal CC BY-SA 3.0
added 156 characters in body
Aug 29, 2013 at 20:05 history edited Jamal CC BY-SA 3.0
added 156 characters in body
Aug 29, 2013 at 19:37 history edited Jamal CC BY-SA 3.0
added 265 characters in body
Aug 29, 2013 at 19:31 comment added Jamal Yes, a struct is okay for a starter. I'm already working on an edit regarding that.
Aug 29, 2013 at 19:30 comment added mitya221 i see :) thank you :D another question: what if I used a struct like this: struct Date { month; day; year; } and then I create two instances of them (one for first_date, and an other for second_date)? Which solution is better?
Aug 29, 2013 at 19:27 comment added Jamal Yes. Generally, using is not good in global scope because it can cause name-clashes. For instance, let's say you've created your own pow(), but have also included <cmath>. What happens if you're using using namespace std? The compiler will not be able to tell them apart, causing errors. Plus, you may also not know which is which. Get the idea? :-) That said, you're welcome to put the using in main() because then it won't be in global scope.
Aug 29, 2013 at 19:23 vote accept mitya221
Aug 29, 2013 at 19:22 comment added mitya221 thanks :) so you mean instead of using the namespaces I should use this (std::cout) form? Is it true for every namespace?
Aug 29, 2013 at 19:15 history answered Jamal CC BY-SA 3.0