hi, i need some advise i have find the hypotenuse,passing three different ways,by value,pointer and reference. i know that c2=a2+b2 but i don't know how to start, any ideas will be aprreciated.

thanks

Printable View

- 12-02-2002dirgnivalue,reference,pointer
hi, i need some advise i have find the hypotenuse,passing three different ways,by value,pointer and reference. i know that c2=a2+b2 but i don't know how to start, any ideas will be aprreciated.

thanks - 12-02-2002kermi3
well if you have to pass all three ways that means you're using functions....

You're probably going to use atleast one function for the calculations, what do you want that function to do? What would the decleration of that function be?

maybe something like this:

float calchypt(Pass the legs in here);

with it actaull being:

Code:`float calchypot(Pass atleast the legs in here)`

{

float temp = leg1^2 + leg2^2;

hypot=sqrt(temp);

//now if you declared hypot in this function,

//then you'll want to return it here

}

Kermi3 - 12-02-2002dirgni
that was fast, thanks,yes the psudo code is now <cmath>for c++.net, i'll fallow your example

- 12-02-2002kermi3
it's always easier than it first looks, if your lucky...I've always found that I just have to lay it all out and look @ it.