In
|
if (round(func)==func)cout<<func<<"\n";
|
you don't call func, you round the function pointer of func.
Also, please don't write it like that. It looks ugly if you put the command in the same line with the if statement X_X
Also, a number of things that you might wanna avoid in future programs (I know this is just a small test thingy, so no big deal but anyways):
Unnecessary use of global variables.
No error checking after input.
system("Pause")- no big deal in test programs, but don't let it become a habit.
AND the worst of them all: you pass a completely useless parameter to func.
To sort out integers/floating point values you might want to let the user input a string, and then check wether it's an integer or a floating point number.