Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
enum
- Page 1
Re: Enum help
Programming
Software Development
11 Years Ago
by L7Sqr
Enum
is a way to provide clarity (and type information) to … integral type so you could just get rid of the `
enum
` altogether and replace with numeric values (by default, `enums` values…
Re: Enum initializing
Programming
Software Development
12 Years Ago
by JamesCherrill
`
enum
Status{WIN, CONTINUE };` That's enough to define and initialise the
enum
, you don't need anything else. What exactly was the comment that confused you?
Re: Enum Help
Programming
Software Development
10 Years Ago
by vegaseat
… use at least Python version 3.4 ... ''' enum_test101.py module
enum
is new in Python34 see: http://legacy.python.org/dev…/peps/pep-0435/ ''' from
enum
import
Enum
class Colour(
Enum
): WHITE = (255,255,255) BLACK = (0,0,0…
enum
Programming
Software Development
17 Years Ago
by Nemoticchigga
Does anyone know the size of an
enum
? If i have [CODE]
enum
foo { YES, NO, MAYBE };[/CODE] is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? Thanks.
Re: enum
Programming
Software Development
17 Years Ago
by Narue
>Does anyone know the size of an
enum
? [code=cplusplus] std::cout<< sizeof ( foo ) <<'\n'; [/code] >is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? The number of constants doesn't change the size of the
enum
.
Enum help
Programming
Software Development
11 Years Ago
by Vikram Sehgal
… there an easier way to write this code?? without using
enum
,
enum
MenuState{MenuPlay,MenuHelp,MenuExit}; MenuState ms=MenuPlay; char ch=0…
Enum Help
Programming
Software Development
10 Years Ago
by matrixdevuk
… it's not working. Any help is appreciated. class Colour(
Enum
): WHITE = (255,255,255) BLACK = (0,0,0) RED = (215…
Re: ENUM - How Is This Done?
Programming
Databases
13 Years Ago
by smantscheff
To retrieve all allowed
enum
values you have to read the table definition. Use the "show create table" statement and parse it for the
enum
field definition.
Re: Enum help
Programming
Software Development
11 Years Ago
by Ancient Dragon
You could use defines instead of the
enum
on line 1 but that wouldn't be any beneficial than what you have now.
Re: Enum Help
Programming
Software Development
10 Years Ago
by matrixdevuk
I installed it via `$ pip install enum34`. It was backported. The syntax is registering perfectly with PyCharm v3 (by JetBrains). See the answer [here](http://stackoverflow.com/questions/36932/how-can-i-represent-an-
enum
-in-python). Thanks for the quick response.
Re: Enum Help
Programming
Software Development
10 Years Ago
by Gribouillis
In ubuntu there is a package `python-enum34` for this, together with 3 other
enum
packages for python.
enum
Programming
Software Development
18 Years Ago
by rowly
…] [/COLOR][COLOR=#800000]<stdlib.h> [/COLOR][COLOR=#0000ff]
enum
[/COLOR][COLOR=#000000] sex {m, f}; [/COLOR] [COLOR=#0000ff]struct…
ENUM - How Is This Done?
Programming
Databases
13 Years Ago
by A T Smith
… domains(name VARCHAR(50) NOT NULL, PRIMARY KEY(name), tld
ENUM
('.com', '.net', '.info', '.org', '.co.uk', '.co', '.biz', '.info', '.de…
enum errors help
Programming
Software Development
16 Years Ago
by CPPRULZ
…make a program with it to test the
enum
syntax and my first one worked. It was… }; switch(whatday) { case 0:
enum
daysinweek enumerator=monday; break; case 1:
enum
daysinweek enumerator=tuesday; break; } cout&… But I got these error messages: 1>
enum
.cpp 1>.\
enum
.cpp(17) : error C2360: initialization of 'enumerator…
Re: enum errors help
Programming
Software Development
16 Years Ago
by StuXYZ
… follow up, I guess that I wouldn't have used
enum
in your case. It is not wrong, it is just…;. These are easier to see with an example: [code=c++]
enum
matrixTYPE { SYMMETRIC = 1, DIAGONAL = 2, SQUARE = 4, .... } [/code] Then you…
Re: enum errors help
Programming
Software Development
16 Years Ago
by StuXYZ
… copy) and at line 6. So you need [code=c++]
enum
daysinweek em; switch(whatday) { case 0: em=monday; break; case…
Re: enum errors help
Programming
Software Development
16 Years Ago
by CPPRULZ
Thank you so much I knew it was probably something to do with scopes. Also, do you know of any other real uses of
enum
other than my example?
Re: enum problem in C#
Programming
Software Development
15 Years Ago
by sknake
…gt;[/icode] Here is a nullable example: [code=csharp]
enum
MyEnum { Value1, Value2 } private void button3_Click(object sender…foreach (string s in stringValues) { try { object o =
Enum
.Parse(typeof(MyEnum), s); enumValues.Add((MyEnum)o); } catch …
Enum Access Issue
Programming
Software Development
13 Years Ago
by skatamatic
…have noticed is how enums work. In C# a public
enum
is considered static, for example: [code] public class … enum2 //etc... } } [/code] If I want to access this
enum
I would simply do something like: [code] int x = (int… object of foo, that object would not contain the base
enum
: [code] foo test = new foo(); int x = …
Enum versus table of text versus text directly
Programming
Databases
15 Years Ago
by griswolf
… hold the status in a column that is an
enum
. The advantage of
enum
are space, speed, fixed values known to the… have to give event staff the power to alter the
enum
in the schema... and event staff are not technical. We… events and event staff, so we used an
enum
and hard coded the
enum
values in our controller code. That decision is…
Re: Enum in application Vs database table
Programming
Software Development
14 Years Ago
by ~s.o.s~
… the cache if you are caching) but for
enum
related changes you'd require either a restart …If for your particular use case, the "
enum
" is part of only the application logic …with having a fixed set of values, the
enum
solution is a pretty good one. As already…. Sure, you can store them all in an
enum
, but would that be a good choice. IMO,…
enum type IO operations with printf,scanf
Programming
Software Development
13 Years Ago
by IndianaRonaldo
… C++ basics now and I read that
enum
types cannot be input directly with cout and… also that type coercion from int to
enum
is not allowed.But when i do this…, [CODE]
enum
SumEnum{ENUM1,ENUM2,ENUM3} SumEnum VarEnum; scanf…CODE] It happens perfectly.printf is ok because
enum
to int coercion is allowed,but how come …
Re: Enum question
Programming
Software Development
13 Years Ago
by Kanoisa
… values and potentially cause undefined results or a crash. [code]
enum
enum_colour_t { red = 0, blue, green}; void getNewColourFromUser( enum_colour_t& newColour…;( newColour); /* !!! the compiler will allow any valid integer into your
enum
variable*/ } void printColour( const enum_colour_t& colour ) { switch( colour ) { case…
Re: enum & typedef
Programming
Software Development
12 Years Ago
by dancks
… useful because without it, if you wanted to use
enum
months with it would have to be declared as void… get_the_date(
enum
months month, etc...) whereas with a typedef you declare… typedef
enum
months{"jan"...} the function can simply be …
enum problem in C#
Programming
Software Development
17 Years Ago
by bhavna_816
I am facing a problem. I have an
enum
which further goes as some string values. … I have a check or validation for that particular
enum
type as if it is null, then display some… parameter, it takes the first value from the
enum
which is wrong and I do not get the…not entered any value? I do not want
enum
to set the default value as the first one…
Re: enum with % (remainder) operator
Programming
Software Development
15 Years Ago
by wildgoose
… do need to assign Monday to the value of zero.
ENUM
specification doesn't specify zero or one for the first…
enum
, and it becomes the call of the compiler manufacturer. So… is no longer a valid
enum
unless you cast it back into an
enum
! [CODE] typedef
enum
weekdayT { Monday = 0,Tuesday,Wednesday,…
Re: Enum Access Issue
Programming
Software Development
13 Years Ago
by Unhnd_Exception
….EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _ Public
Enum
Foo none = 0 End
Enum
End Class [/code] That will get rid of…
Re: Enum Access Issue
Programming
Software Development
13 Years Ago
by skatamatic
….EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)> _ Public
Enum
Foo none = 0 End
Enum
End Class [/code] That will get rid of…
Re: enum vs #define vs const
Programming
Software Development
13 Years Ago
by mike_2000_17
…mine. For your particular case, definitely, go with an
enum
type. That is exactly what they are for, for enumerations… efficient to represent them as integer variables (within an
enum
) where all bits except one is zero. You might…in general, if you are representing an enumeration, use an
enum
type. Otherwise, a const-variable is fine, and please …
Enum initializing
Programming
Software Development
12 Years Ago
by GeekTool
…Craps { private static final Random randomNumbers = new Random(); private
enum
Status { COUNTINUE, WIN, LOST }; private static final int SNAKE_EYES…Random; import java.util.Scanner; public class Rasgele1 { public
enum
Status{WIN, CONTINUE }; public static void main(String[] args…
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC