ENUMS in C++ explained easy 📅

Поділитися
Вставка

КОМЕНТАРІ • 15

  • @BroCodez
    @BroCodez  2 роки тому +6

    #include
    enum Day {sunday = 0, monday = 1, tuesday = 2, wednesday = 3,
    thursday = 4, friday = 5, saturday = 6};
    int main () {
    // enums = a user-defined data type that consists
    // of paired named-integer constants.
    // GREAT if you have a set of potential options
    Day today = friday;
    switch(today){
    case sunday: std::cout

  • @Anonymationsthecoolanimator

    Oh my, visited this channel after a while and so much new content to watch!
    GREAT!

  • @SurajDas-zi7wb
    @SurajDas-zi7wb 2 роки тому +2

    thanks you so much for the lecture 💜 eagerly waiting for oop leacture :)

  • @Dazza_Doo
    @Dazza_Doo Рік тому

    Although the point of this exercise is to use enums, here a swtich epressions is why I love them.
    Enums can be difficult to iterate though, and maybe getting the sizeof(Enum) might work in C++, in C# it gets a little advanced.

  • @user-mw1ss4ii3z
    @user-mw1ss4ii3z Місяць тому

    have one doubt, how to use enums in arithmetic operations?

  • @Dazza_Doo
    @Dazza_Doo Рік тому +3

    enum SheSaid {big = 7, small = 6, thin = 1, skinny = 0, oh-no = 10, get-out-of-here = 100};

  • @JackEvans-hf7qt
    @JackEvans-hf7qt 11 місяців тому

    //program to display planet's info using enumeration(enums) in c++
    # include
    using namespace std;
    enum planets
    {
    Mercury,Venus,Earth,Mars,
    Jupiter,Saturn,Uranus,Neptune
    };
    int main()
    {
    planets planet=Mercury;
    switch(planet)
    {
    case Mercury: cout

  • @TheLord0fNight
    @TheLord0fNight 5 місяців тому

    enum Variables{integer, boolean}; Other variables didn't work

  • @danaildoganov
    @danaildoganov 2 місяці тому

    #include
    enum player {Messi, Ronaldo, Neymar, Ronaldinho, Suarez, Stoichkov};
    int main() {
    player best = Ronaldinho;
    switch(best){
    case Messi: std::cout

  • @myselfakashagarwal
    @myselfakashagarwal 2 роки тому +2

    Bro please say my name in next video