// this function returns int
int SquareInt ( int x )
{
return x * x;
}
// this function returns float
float SquareFloat ( float x )
{
return x * x;
}
// For example, if I wanted to consolidate
// these two functions into one, how would
// I go about doing this?
some_dataype Square ( some_dataype x )
{
return x * x;
}
// then I can do something like
float a = Square (some_float_var);
int b = Square (some_int_var);