enum declaration inside method

  • Thread starter Thread starter Tom Jones
  • Start date Start date
T

Tom Jones

Is there something wrong with doing this:

class Foo
{
void SomeMethod()
{
enum Test { A, B, C };
// use Test ...
}
}
 
Hi,

You cannot declarate a enum inside a method, you can declare it inside the
class though.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Array casting bug?? 3
Can't use delegate in attribute 3
enum string value 3
Enum TypeConverter 3
Internal Error and enums 7
Enum Extentions 7
Check Flags Enum for Validity 15
How to do an enumeration in an interface? 3

Back
Top