Top "Enums" questions

A data type consisting of a set of named values called elements, members or enumerators of the type.

C# Iterating through an enum? (Indexing a System.Array)

I have the following code: // Obtain the string names of all the elements within myEnum String[] names = Enum.GetNames( typeof( …

c# enums iteration system.array
what is the size of an enum type data in C++?

This is a C++ interview test question not homework. #include <iostream> using namespace std; enum months_t { january, …

c++ enums sizeof
Can I display the value of an enum with printf()?

Is there a one-liner that lets me output the current value of an enum?

c printf enums
Best way to define error codes/strings in Java?

I am writing a web service in Java, and I am trying to figure out the best way to define …

java enums
Swift: Convert enum value to String?

Given the following enum: enum Audience { case Public case Friends case Private } How do I get the string "Public" from …

string enums swift
How to convert enum names to string in c

Is there a possibility to convert enumerator names to string in C?

c string enums
How to create enum like type in TypeScript?

I'm working on a definitions file for the Google maps API for TypeScript. And I need to define an enum …

enums typescript
Enums in Javascript with ES6

I'm rebuilding an old Java project in Javascript, and realized that there's no good way to do enums in JS. …

javascript enums ecmascript-6 immutability symbols
enum Values to NSString (iOS)

I have an enum holding several values: enum {value1, value2, value3} myValue; In a certain point in my app, I …

ios enums nsstring
How to add extension methods to Enums

I have this Enum code: enum Duration { Day, Week, Month }; Can I add a extension methods for this Enum?

c# .net enums