private Point bounds(int dx, int dy)
{
Point dest;
enum piecewiseBounds { beyondCircle = 866, outerCircle = 315, top = 270, innerCircle = 0};
if (dx > piecewiseBounds.beyondCircle)
{
}
else if (dx <= piecewiseBounds.outerCircle)
{
}
else if (dx < piecewiseBounds.top)
{
}
else if (dx < piecewiseBounds.innerCircle)
{
}
return dest;
}
[.net] C# enum
I'm trying to create this method.
but I get an array of errors when I have enum inside the function, none when it's in the class definition. Is it not possible to define an enum inside a function? I really only need it within the scope of that function. I guess I'm supposed to use const?
Quote:Original post by ELFanatic
Is it not possible to define an enum inside a function?
correct, not possible
Quote: I really only need it within the scope of that function.
define it as private in member in the class. It will still have class-level scope, but it won't be accessible any higher than that.
Quote:I guess I'm supposed to use const?
wut?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement