Calling all Dev_C++ users,
Here's a mystery! The following little program, which determines whether one integer is a divisor of another or not, compiles and runs fine using Borland's bcc32.
#include <iostream>
using namespace std;
bool divides(int,int);
main()
{ int a,b;
char ch;
cout << "Enter a then b: ";
cin >>a>>b;
if(divides(a,b))
cout << a << " is a divisor of "<<b<<'\n';
else
cout << a << " isn't a divisor of "<<b<<'\n';
cin >> ch; //for dev-c++
}
bool divides(int b,int a)
{ if (!(a%b))
return true;
return false;
}
When I try compiling it using Dev_C++ I get the message that there's a problem on line 9 because that's the first use of the function "divides". Apparently the compiler is ignoring the function prototype. Now comes the really strange part! If the function name is changed (all three times that it occurs) to almost anything I try, like "divideth" or "fct" or "product" the program works fine, but if I change it to "multiplies" I get the same compilation error.
Can anyone explain this phenomenon?