Enums in C# 2005 (Beta 2) Framework 2.0

  • Thread starter Thread starter SpotNet
  • Start date Start date
S

SpotNet

Hello CSharpies,

Can Enums in C# be UInt32 Types, and not just Int32 Types. I have a lot of
constant declarations that are UInt32 that I want to put in Enums to ease
the use of Intellisence. I have them in structs for now, I thought I'd ask.
Would IntPtr Enums push the bounds of a stupid question?

Regarding a post a bit further down by Tom;
'[Offtopic] What would you like to change in C# and .NET?'

Enums of different types purely for rounding up like groups of alike
constant declarations for neatness and intellisense usage. Since the
functionality and purpose of structs goes beyond just grouping constants, an
emum would make better sense. I know this would defy the meaning of Enum for
most other native types.

- Thanks Newsgroup

SpotNet.
 
SpotNet said:
Hello CSharpies,

Can Enums in C# be UInt32 Types, and not just Int32 Types. I have a lot of
constant declarations that are UInt32 that I want to put in Enums to ease
the use of Intellisence. I have them in structs for now, I thought I'd
ask. Would IntPtr Enums push the bounds of a stupid question?

UInt32 yes, (C# alias is uint,btw)

public enum Name : uint
{

}

I believe you have to use uint, not UInt32, however.

IntPtr...no, not supported.
 

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

Back
Top