HEllo, I need to call a function up twice withing another function. My problem is the fact that the second itme I call it up it overwrites the first one. Here is what I have for the code (getYear() is the function I am calling up):
void doYearRange()
{
int dys=0;
int yr;
int yr1;
int yr2;
yr1 = getYear();
yr2 = getYear();
for (yr =yr1; yr<=yr2; yr++)
if (isLeapYear(yr) ==true)
{
std::cout<<yr<<endl;
dys +=366;
}
else dys +=365;
std::cout<<dys<<" days between "<<yr1<<" and "<<yr2<<endl;
}