Cant figure out error w/ passing values between functions!

#include <cstdlib>
#include <iostream>

using namespace std;
bool funcLetter(int num);

int main()
{
int num;
int x;
cout<<"Enter a number: ";
cin>>num;
if (funcLetter(int num)==1)
cout<<"Number is greater than 10";
else
cout<<"Number is less than 10";

system("PAUSE");
return EXIT_SUCCESS;
}


bool funcLetter(int num)
{
if(num>=10)
return true;
else
return false;
}





the step bolded i get an error that says "expected-primary expression before "int"
i can not figure out for the life of me why this is not compiling.
keep in mind i am 6 weeks into a beginner c++ course and just learning the syntax of the language.
(using bloodshed compiler)
When passing parameters, you don't re-declare the type, as you have already stated it is an int when you defined it above. Also, since your funcLetter() returns a bool, you can just use it in the if directly, i.e.:

 
if(funcLetter(num)) //if it returns true 
thanks alot!
it worked right away!
Topic archived. No new replies allowed.