#include <iostream>
#include <conio.h>
using namespace std;
void Works(int n) {
#if n % 2 == 0
#error 'n' is even
#endif
cout << n;
}
int main()
{
Works(3);
getch();
}
I get an error on compilation telling me that "'n' is even" even if it is not. This also happens if I add an n = 3; inside the function:
void Works(int n) {
n = 3;
#if n % 2 == 0
#error 'n' is even
#endif
cout << n;
}

New Topic/Question
Reply




MultiQuote








|