473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What is enum?

i'm confused! what exactly is this function type and where should i use it?
appreciate any answers, clear article or anything.


Nov 15 '05 #1
4 1406
Enum is basic blue man, it's a concept you should know very well if you've
ever programmed. Enum allows you to define your own enumerated types. So you
can have weekdays = (monday, tuesday, wed... etc) where monday would be 0,
tuesday would be 1, and so on... this makes your code easier to read when
you intend to use integers to represent options. ie: instead of if(option ==
3) you'd have if(option == thursday).

"Blue Man" <bl**********@nospam.com> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
i'm confused! what exactly is this function type and where should i use it? appreciate any answers, clear article or anything.

Nov 15 '05 #2
Blue Man wrote:
i'm confused! what exactly is this function type and where should i use it?
appreciate any answers, clear article or anything.


An enumeration is a type which has a finite set of *possible* values
defined either implicitly or explicitly when it's created.

Check this article out:
http://www.csharp-station.com/Tutorials/Lesson17.aspx
Nov 15 '05 #3
It's is not a function type, an enum is a type whose domain is a set of
named integral-type constants. Good examples in the docs:
http://msdn.microsoft.com/library/en...ationTypes.asp
"Blue Man" <bl**********@nospam.com> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
i'm confused! what exactly is this function type and where should i use it? appreciate any answers, clear article or anything.

Nov 15 '05 #4
C# Learner wrote:
Blue Man wrote:
i'm confused! what exactly is this function type and where should i
use it?
appreciate any answers, clear article or anything.

An enumeration is a type which has a finite set of *possible* values
defined either implicitly or explicitly when it's created.


"when it (the enumeration) is defined", rather.
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kenneth | last post by:
I want to define an enum for possible languages in my application. My enum look like this: Public Enum Languages English = 0 Portuguese = 1 End Enum How can i reuse this enum in the rest of...
0
by: Vaclav Haisman | last post by:
Motivation: I have been working on some project recently that uses lots of enums with disjunctive intervals of values because it is rather convenient way to define series of constants with...
8
by: Bruno BAGUETTE | last post by:
Hello, I have to migrate a MySQL database to a PostgreSQL database without procedures. The problem is that this MySQL database uses ENUM, do you see what can I do to migrate ENUM into...
6
by: randy1200 | last post by:
The following enum is given to me, and I can't change it: enum yo { ONE, TWO, THREE }; I have the following: char test = "ONE"; Any ideas on how to see if the string in "test" is in the...
1
by: Fei Li | last post by:
Hi, Whi can help to expain what logic is when I cast enum a to b? Thanks
2
by: Dennis | last post by:
I have an enum as follows: Public Enum myData FirstData = 6 SecondData = 7 end enum Is there anyway that I can return the Enum names by their value, i.e., I want to input 6 into a function...
2
by: Alex Feldman | last post by:
Which of the following is better? Defining an enum type inside a class as a nested type, or in the the namespace? An example of nested type enumerated type would be: public Class Product...
5
by: Peteroid | last post by:
Using VS C++.NET 2005 Express in clr:/pure syntax. I have this enum, defined like so: enum My_Enum { ENUM_0 = 0, ENUM_1 } ; My_Enum enum_var ;
1
by: PSN | last post by:
can any one tell me if there is a way to redeclare a typedef enum to add new elements at the end .. Ex: "test.h" typedef enum test1 { hcone = 0, hctwo hcthree, hcfour,
12
by: Cmtk Software | last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI managed c++ and from C#. I defined the following enum in a VS dll project set to be compiled with the /clr switch: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.