I am trying to solve this exercise on Exercism website. The exercise is about finding the leap year. I have two files, main one and the header file.
The main one:
#include "leap.h"
int main (){
leap::is_leap_year(int year);
}
The header file:
#if !defined(LEAP_H)
#define LEAP_H
#include <iostream>
#include <string>
namespace leap {
bool is_leap_year(int year) {
bool status=1;
if (((year%4 == 0)&& (!(year%100==100))) || ((year%100==0)&&(year%400==0))){
return status;
}
else{
status = 0;
return status;
}
}
}
#endif // LEAP_H
Whenever I run this code I keep getting this error: expected primary-expression before 'int'
If I removed int from
leap::is_leap_year(int year);
I will get this error: 'year' was not declared in this scope