public class Human
{
public setGender Gender { get; set; }
public void setHeight(Human Person)
{
if (Person.Gender == setGender.Male) // <-- This is where the error is.
{
}
}
}
public struct setGender
{
public static setGender Male { get; set; }
public static setGender Female { get; set; }
}
When I put in the preceding code, I get this error saying,
operand '==' cannot be applied to operands of type 'Life.setGender' and 'Life.setGender'
(The namespace is "Life" by the way. That is why it is 'Life.setGender')
I had tried to look it up but I still don't know what that means. Could someone please help me with error.
I am using C#.
I am pretty sure what you really want is this: