function return?

So say I had a program that went like

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 #include <iostream>
using namespace std;
bool check(int x)
{
  if(x == 10)
  {
    return true;
  }else{
    return false;
  }
}
int main()
{
  cout << check(50121);
  return 0;
}

I would expect it to return false, but it returns '1' every time. Even if I make the return type of the function int, it still returns 1, no matter what. Some info on how this works/what I can do instead of it?
This function returns 0, NOT 1. It will return 1 only if the value of 'x' is 10.

Sorry I was working with something else similar to this that wasn't working; I just used this as an example. Anyways, I have it figured out now. Thanks.
Topic archived. No new replies allowed.