Creating function eqQuadSides

Hi all,

I have to create a function that will return how many sides of a quadrilateral are equal.

Here is what I've come up with:

bool eqQuadSides(int eqSides = 0)
{

if (a == b)
{ ++ eqSides;}
if (a == c)
{ ++ eqSides;}
if (a == d)
{ ++ eqSides;}
if (b == c)
{ ++ eqSides;}
if (b == d)
{ ++ eqSides;}
if (c == d);
{ ++ eqSides;}

return eqSides;

}

Am I on the right track?
Several problems.
1) You can't declare int eqSides = 0 in your function definition.
2) Your return statement is returning an int, but your function is declared as a bool.
3) If your quadrilateral is a square, you're going to return a count of 6.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Topic archived. No new replies allowed.