Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6112493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:45:05+00:00 2026-05-23T14:45:05+00:00

Is it possible to cycle and extract its value for every item in an

  • 0

Is it possible to cycle and extract its value for every item in an enum, e.g:

enum {
   item 1 = 1,
   item 2 = 7,
   item 3 = 'B'
} items;

To say, an array. Possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:45:06+00:00Added an answer on May 23, 2026 at 2:45 pm

    Do you mean to construct an array with one element for each value of the enum? Such that you would end up with an array {1, 7, 'B'}?

    Not possible. An enum is not much more than a bunch of compile-time constants. At runtime, they are effectively just ints. The compiler doesn’t even check to make sure you are putting valid values in your enum variable (you could put the value 5 in there and it wouldn’t mind). So it has no knowledge of what the possible enum values are at runtime.

    Of course, if your enum is contiguous (say, you had defined an enum for the values 0, 1, 2 and 3), then you can do this using a for loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Its possible to retain a Fragment between Activities? Lets say I have Activity A
http://jquery.malsup.com/cycle/ Is is possible to randomise the cycled content with the jquery jcycle plugin?
Is it possible to compare whole memory regions in a single processor cycle? More
Is it possible to print full list without using cycle? I tried: Console.WriteLine([1;2;3;4;5]) and
Possible Duplicate: How to determine if a linked list has a cycle using only
Using the jQuery Cycle plugin is it possible to change the length of the
Possible Duplicate: Android Activity Life Cycle - difference between onPause() and OnStop() Can anybody
Possible Duplicate: Best algorithm to test if a linked list has a cycle p=head;
I was wondering if it is possible to call a non-life-cycle method of a
Is it possible to have a div and its contents (images class and associated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.