Need help with bool implementation.
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
bool isSingleDigit(int x)
{
if(x>=0 && x<10){
return true;
}
else{
return false;
}
}
int main(){
int y;
cin>>y;
bool z=isSingleDigit(int y);
if(z){
cout<<"the number is a single digit";
}
else{
cout<<"the number is not a single digit";
}
getch();
return 0;
}compiler throws : Expected primary-expression before int for the line in bold/italics. Help.