My error says that type powers already defines a member called 'op_ExclusiveOr' with the same parameter types?????
any help
CODE
using System;
class Powers
{
public int x;//, y, z;
public Powers(int x)//, int y, int z);
{
this.x = x;
//this.y = y;
//this.z = z;
}
public Powers(Powers rhs)
{
x = rhs.x;
//y = rhs.y;
//z = rhs.z;
}
public override string ToString()
{
return "( " + x + " )";//, " + y + ", " + z + " )";
}
public static Powers operator ^ (Powers lhs, Powers rhs)
{
Powers result = new Powers(lhs);
result.x = rhs.x * rhs.x * rhs.x;
//result.y = rhs.y * rhs.y * rhs.y;
//result.z = rhs.z * rhs.z * rhs.z;
return result;
}
//public static Powers operator ^ (Powers lhs, Powers rhs)
//{
// return new Powers(lhs * rhs.x);
//}
public static double operator ^ (Powers lhs, Powers rhs)
{
return lhs.x * rhs.x;
}
} //END CLASS POWER
class RaisePower
{
public static void Main(string[] args)
{
Powers p1, p2, p3;
p1 = new Powers(3);
p2 = new Powers(3);
p3 = p1 ^ p2;
result = p1 ^ p2;
Console.WriteLine("p1 = " + p1.ToString());
}
}