I am writing a method that takes two dates from user input and then creates a vector of dates with each day between the two.
Example:
User inputs 06/10/2007 and 06/16/2007
Vector of Dates should contain:
06/10/2007
06/11/2007
06/12/2007
06/13/2007
06/14/2007
06/15/2007
06/16/2007
The problem I am running into is I have a for loop that gets the difference between the two days and runs through and adds the begin date plus 1 to the vector.
Then I print the vector, well as you might see, when I print the results from the vector, I get 06/17/2007 for all dates. I am guessing that when I add the date to the vector, it is adding the address of the date, therefore they all technically point to the same date, which by the end of the for loop is 06/17/2007.
How do I put the actual value of the date in the vector instead of the address to that date?
Is that possible?
Any guideance would be appricieated.
Thanks
Chris
Example:
User inputs 06/10/2007 and 06/16/2007
Vector of Dates should contain:
06/10/2007
06/11/2007
06/12/2007
06/13/2007
06/14/2007
06/15/2007
06/16/2007
The problem I am running into is I have a for loop that gets the difference between the two days and runs through and adds the begin date plus 1 to the vector.
Then I print the vector, well as you might see, when I print the results from the vector, I get 06/17/2007 for all dates. I am guessing that when I add the date to the vector, it is adding the address of the date, therefore they all technically point to the same date, which by the end of the for loop is 06/17/2007.
How do I put the actual value of the date in the vector instead of the address to that date?
Is that possible?
Any guideance would be appricieated.
Thanks
Chris