I am writing a function that will return the type of triangle generated by the length of the three sides as inputted by the user. I am using an enumerated data type that is declared as follows:

enum KindOfTriangle {SCALENE, ISOSCELES, EQUILATERAL, IMPOSSIBLE};

Next I declare a variable of this type and call it:

triangleType

Later down in the funcion I attempt to assign a value to this variable after certain condtions of an "if" statement are met with the following statement:

triangleType = ISOSCELES;

I do this for each of the four types of triangles further down in the function. When I try to compile the code I receive the following error code for each attempt to use the assignment operator:

error C2659: '=' : overloaded function as left operand

I am using Visual C++ 6.0. Does anyone have an answer for this? I know it is because I am not using the enumerated data type correctly. None of my books go into very much detail regarding this.