can you tell me why this boolean check is wrong? I want to check if its integer or not I don't want a double or float its just an integer in c++ I tried this code but it`s always give me integer
bool isInt(int a) {
if (sizeof(a)==4) {
cout << "integer";
}
else
cout << "not integer";
return 0;
}
void main() {
int a=15.5;
isInt(a);
}