defineing classes

Can you have a returned message out of a class?
example
void Rectangle::setDimensions(float len, float wid)
{ // assigns length and width
if (len > 0 && wid > 0)
{ length = len;
width = wid;}
else if (len<0 || wid<0)
{cout<<"Invalid lengt or width";
}//end ifs
}//end setDimensions function


Comments

  • : Can you have a returned message out of a class?

    ... As far as I know...yes!(but I'm not sure) Why don't you teste it?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion