If statement error

I am trying to write a program in which the user can enter a date in the format "MM/DD/YYYY" or "DD/MM/YYYY" and the program will tell the user what day of the year it is. For example, if the user entered 12/31/2015, the program will tell the user it is day 365 of the year. I am using an if statement to display an error message if the user enters a leap day on a year other than a leap year, but I get the error "left operand must be Ivalue" on line 37 column 17. According to the Microsoft Developer Network
http://msdn.microsoft.com/en-us/library/wxy5f14h.aspx
my format should be OK but I still get the error. WTF?

Heres the code so far:

#include <iostream>
#include <string>
using namespace std;

void display();
void usOReuro();
void USformat(int, int, int);
void EUROformat(int, int, int);

int jan = 31, feb = 28, leap_feb = 29, mar = 31, apr = 30, may = 31, jun = 30,
jul = 31, aug = 31, sep = 30, oct = 31, nov = 30, dec = 31;

int main()
{
display();
usOReuro();
}

void display()
{
cout << "Welcome to Bill and Ted's Excellent Calendar App" << endl << endl;
cout << "Please enter the date: ";
}

void usOReuro()
{
char slash;
int num1, num2, year;
cin >> num1 >> slash >> num2 >> slash >> year;
if (num1 < 12 && num2 < 12)
USformat(num1, num2, year);
}

void USformat(int month, int day, int year)
{
int day_num;
if (month = 2 && day = 29 && year % 4 != 0) // Line with error
cout << "ERROR: You have entered an invalid date!\nThis date does not exist on the calendar." << endl;
if (month = 1)
day_num = day;
if (month = 2)
day_num = jan + day;
}

Any help would be appreciated
Sorry about this guys now I feel stupid. I forgot to use the == relational operator and rather used a single =.
Topic archived. No new replies allowed.