*** Systems ***
OS: Windows 8.1 64bit
IDK: MS Visual Studio Express 2013 for Windows Desktop
Problem: I created a simple (very simple) User-defined function named func_compare that compares two numbers, it has two parameters of type Integer.
It has no errors whatsoever until you compile it, and it says identifier func_compare not found.
It seems to me that my compiler does not know that it was actually a user-defined function. I am also suspecting that my IDK is missing some components???
Here is my code;
__________________________________________________________________
#include <iostream>
using namespace std;
int main(){
int num1, num2;
cout << "Enter two numbers: ";
cin >> num1 >> num2;
int larger;
larger = func_compare(num1, num2);
cout << larger << endl;
return 0;
}
//here is my user-defined function
int func_compare(int x, int y){
if (x > y)
{
return x;
}
else
if(y>x){
return y;
}
else
{
cout << "The numbers are equal!";
}
}
__________________________________________________________________