1. [ANNOUNCEMENT] Hello Guest, Buying Target|BestBuy|Ebay|Google|GoBank|Itunes|Apple|Walmart| good rate CLICK HERE!

C++/CLI Enumerations

Discussion in 'Programming, Scripting & Coding Discussion' started by beingchinmay, Aug 30, 2016.

  1. beingchinmay

    beingchinmay ECZ Member

    Joined:
    Jan 1, 2016
    Posts:
    130
    Likes Received:
    0
    Enumerations in a C++/CLI program are significantly different from those in an ISO/ANSI C++ program. For a start you define an enumeration in C++/CLI them slightly differently:

    enum class Suit{Clubs, Diamonds, Hearts, Spades};

    This defines an enumeration type, Suit, and variables of type Suit can be assigned only one of the values defined by the enumeration—Hearts, Clubs, Diamonds, or Spades. When you access the constants in a C++/CLI enumeration you must always qualify the constant you are using with the enumeration type name. For example:

    Suit suit = Suit::Clubs;

    This statement assigns the value Clubs from the Suit enumeration to the variable with the name suit. The :: that separates the type name, Suit, from the name of the enumeration constant, Clubs, is the scope resolution operation and indicates that Clubs exists within the scope of the enumeration Suit.
     
  2. John Bryce

    John Bryce ECZ Member

    Joined:
    Jul 24, 2015
    Posts:
    280
    Likes Received:
    4
    You can’t figure out these things easily, as it takes a lot of knowledge and experience to crack it up. I say try out to Visit Website like Svitla, it covers one to long distance, with allowing easy route towards something incredibly challenging. Getting into software/programing world is NOT easy and is not meant to be that way either, but with such creations, the work become rather simpler, especially for the beginners.