Is there a built in function or a way to query the size of an emun typedef?
typedef enum difficultyTypes {
kEasy,
kMedium,
kHard
} difficultyType;
I would like a way to query and have it ( in this case ) return 3.
I could even deal with it returning 2 as the highest value ( 0,1,2 ).
Or am I forced to use another int variable that I s...
When I compile my .y file with bison parser.y -d -t and then include the parser.tab.h file in my flex file, gcc says "error: syntax error before numeric constant." It's referencing line 32, which is the first line in the enum of yytokentype.
enum yytokentype {
BREAK = 258,
... }
The error is about the line "BREAK = 258." I hone...
Hi,
I want to bind an enum which has flags attribute to a listbox with a check list box item template in mvvm pattern? How can I do this?
[Flags]
public enum SportTypes
{
None = 0,
Baseball = 1,
Basketball = 2,
Football = 4,
Handball = 8,
Soccer = 16,
Volleyball = 32
}
<ListBox Name="checkboxList2"
...
I have a Employee class and department class.Now within employee i have a department as its member.The department can be either of 2 type "HR" or "Admin".Now should i declare departmentype as a enum in a separate interface and then should model department class as show below?
public interface Myconstants{
enum Depttype{HR,Admin};
}
...
public enum ItemType{REFRENCE,ISSUE};
ItemType itemType = IntemType.ISSUE ;
int intemNo=0;
I am geting error wheni use above code?why is it so?
...
I have a classes as below
public class Book extends Item{ ...}
public class DVD extends Item{ ...}
Book can be of type REFRENCE or ISSUE.
DVD can be of type ISSUE only.
So should I create Item as follows?
public class Item {
public enum ItemType{REFRENCE,ISSUE};
ItemType itemtype;
}
Or I should declare seperate enum for bot...
Hi there ! Is there any java (>5) enum for listing european countries and languages somewhere ?
If there aren't any, I'll probably write them from this list : http://www.nationsonline.org/oneworld/european_languages.htm
But if I could avoid that burden, that would be great !
Thanks in advance !
Philippe
P.S. : Finally, I'm starting t...
Hi,
are there any restrictions / problems using an enum as template (type) argument in C++?
Example:
enum MyEnum
{
A, B, C, D, E
};
template <typename _t>
class MyTemplate
{
public:
_t value;
void func(const _t& param) { /* .... */ }
};
// ....
MyTemplate<MyEnum> MyInstance;
My actual problem using MSVC++ via VS 2008...
i have an asp.net-mvc webpage and i want to show a dropdown list that is based off an enum. I want to show the text of each enum item and the id being the int value that the enum is associated with. Is there any elegant way of doing this conversion?
...
I have some client data that I am reading in, and I've defined an Enum for one of the values, so I can use Enum.Parse(type, somestring).
The problem is they just added a new value: "public". Is it possible to define an enum value that is also a reserved word?
I.E.:
public enum MyEnum {
SomeVal,
SomeOtherVal,
public,
Y...
I ahve a combo whose source is an Enum. Now , among the other values(say value1, value2
etc.) there is one item Changes(%) that will be displayed in the combo .
How to define Changes(%) in the enum?
Using C#3.0
Thanks
...
Hi, I want to have an enum like the following and then have a method something like Util.FindFruitByValue("A") which returns the enum Apple. this is because the abbreviations are stored in database and I need to convert them to appropriate enums after reading from db. is this possible OR do I need to create a separate class for it? Pleas...
As I know C enum is unsigned integer, but this may vary by implementation.
What type should I use for the enum in binary representation?
*PS
'binary representation' means byte-array. I want to serialize enum values to socket to inter-operate with other programs.
...
public Car{
public enum Color{RED,BLUE};
private Color color;
Car(Car.Color c)
{
this.color =c
}
}
is it the correct way?
...
I posted other question: http://stackoverflow.com/questions/3509470/what-type-should-i-use-for-binary-representation-of-c-enum, and by the answer, I have to know my compiler's enum data-type.
What's the data-type of C enum on Clang compiler?
...
I have the following enum that represent a state of UI (I use it to enable and disable UI elements):
enum Mode
{
EDIT, RUN, REVIEW
}
I would like to pass Mode.EDIT to command in CommandParam:
<Button Grid.Column="6" VerticalAlignment="Top Command="{Binding Path=ChangeMode}"
CommandParameter="{StaticResource local:Mode.RUN}" /...
What is main use of Enumeration in c#?
Edited:-
suppose I want to compare the string variable with the any enumeration item then how i can do this in c# ?
...
Hello, how can I do to simulate a class of type enum in java <5.0 ..??
public final class Week {
private static final Day[] _week = {Day.MONDAY, Day.TUESDAY, Day.WEDNESDAY, Day.THURSDAY, Day.FRIDAY, Day.SATURDAY, Day.SUNDAY};
public static Day getDayOfWeek(final int index) {
if (index >= 1 && index <= 7) {
...
Enum.TryParse(,,out) not supporting in vs2008 in c#? why? I am trying to use but getting error that TryParse no defined.
...
I have my enum, which I don't want to share between layers.
So I was thinking wrapping it up would be neat.
But how ? There are many items, manualy writing down all items isn't a solution.
Also the enum is getting generated.
I'd like to keep the intelisense.
...