Sorry because of my bad english, and thaks because of the ideas, now it works, but please somebody can expline me why we have to do static_cast<double> ???????????????????????????????????????????????
I don't finish the program, but the option 1 works perfectly
1st) ¿Why apears a problem when i press 1 in the execution time?
2nd)¿Why the operation (-) it doesn't do what it has to do ?¿why appears all the time 0?
Moving delete frac to lines 59 and 70 will work the first time through the loop, but will not work the second time through the loop.
You allocate frac at line 18. Lets assume you enter 1 the first time through the loop. frac now gets deleted at line 59. Lets assume you choose option 1 again the second time through the loop. You proceed to calculate using frac at line 56, but frac has been deleted and now points to garbage.
Ok, I think that I have impluve a lot the program, but I ned to know what happens in the line XX with the pow() I don't know why appear this error: "Error 1 error C2039: 'elevacion' : is not a member of 'main::fraccion' "
struct fraccion
{
double numerador;
double denominador;
// do you see name 'elevacion' here? The compiler does't.
};
////
fraccion frac;
double x = frac.elevacion; // error C2039