As an example, inside your Calc function, you might do this
Code:
float* Calc(float num1, float num2, char c)
{
pFunc pFuncRes =GetPointer(c); // simpler way of getting the pointer
float *resultF = pFuncRes(num1, num2); // store the returned pointer
float returnvalue = *resultF; // store the value pointed to
delete resultF; // release the allocated memory
return returnvalue;
}
Anyway, the best thing you could do is change the return values of your functions from float * to float. Just because you CAN return a pointer, doesn't mean it's a good idea. As exhibited by the hoops jumped through in my example to make things work right.
It is a moderately common Java technique to dynamically allocate a value, and later forget about it. This works in Java for a number of reasons (eg garbage collection, semantics of "what is a variable") but such techniques are really bad karma in C++.