The following functions are supposed to return a random int or a random double number. However the following function overloading is illegal in C++ since the parameters of both functions are the same (they both do not pass any parameters to the function):
int getRand();
double getRand(); //ERROR!!!
One way to fix this error and have two functions to return a random int or double is to have different function names, i.e.:
int getRandInt();
double getRandDouble(); //CORRECT!
What is an alternative way to still do function overloading (having the same name for the both above functions) where one returns a random int and the other returns a random double without any errors? Write the function prototypes and explain short but briefly