- #1
Whovian
- 652
- 3
Since I'm doing this for a problem of sorts on a site anyone can join, I won't release my whole code, but here's what I tried.
But the prototype and the bit at the end would make there a matching function, I thought?
Code:
#include <iostream>
enum month {jan,feb,mar,apr,jun,jul,aug,sep,oct,nov,dec};
enum weekday {sun,mon,tue,wed,thur,fri,sat};
int year;
int numberofdays(month);
void plusone7(weekday&);
int main()
{
int number = 0;
int suns = 0;
//Some code
std::cout << number << " days total." << std::endl;
weekday dayofweek;
for (int day = 1,dayofweek = mon;day<=number;day++,plusone7(dayofweek)) //"No matching function for call to plusone7"
{
if (dayofweek == sun)
{
suns++;
}
}
std::cout << suns << " is the number of sundays" << std::endl;
}
//Defines a few functions
void plusone7(weekday& added)
{
if (added == sat)
{
added = sun;
}
else
{
added++;
}
}
But the prototype and the bit at the end would make there a matching function, I thought?