I have this code that I am trying to compile and I keep getting an error C2664 message. I am not sure what to do with the code that it is pointing to. (This is just part of the program code but I get this same error in another part of the code)
Code:
#include <iostream>
using std::cout;
using std::endl;
#include <ctime>
#include <cstdlib>
enum Months { JAN = 1, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC };
void generateDate( int &, int &, int );
void printDate( Months, int, int );
int validDate( int, int );
int main()
{
int month = 1;
int day = 1;
int year = 1900;
int getYear;
int getMonth;
int getDay;
int Month;
int myMonth;
srand( time( 0 ) );
printDate( month, day, year );
year = getYear ( year );
month = getMonth( month );
day = getDay( day );
if (validDate (month, day, year) == true )
printDate ( month, day, year );
return 0;
} // end main
This is the whole error message:
error C2664: 'printDate' : cannot convert parameter 1 from 'int' to 'enum Months'
Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
Any help will be appreciated.