No video

ENUMS in every programming language (All you need to know)

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCpp...
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObj...
🚀📈💻🔥 My Practical Programming Course: www.codebeauty...
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
Download Visual Assist here: bit.ly/WT-CB
I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
Download Ultra Edit here: bit.ly/UE_CB
It is a powerful, secure text editor designed specifically for programmers.
☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. You can use the link below to make a contribution: bit.ly/CodeBea...
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
In this video, I'll teach you everything you need to know about enumerations in every programming language.
By using enums you increase compile-time checking of your code and avoid errors that can happen by using invalid constants (numbers or strings). This is because enums let you define which values are legal to use.
You'll also learn about the relationship between enums and loops, enums and functions, casting enums and handling user input, as well as iterating through enum elements and using an enum as a function parameter.
After watching the entire video you'll be able to understand what are enums and apply this knowledge to any other programming language. This will help you to write cleaner code that will be easier to understand and maintain.
Contents:
00:00 - What is enum?
02:53 - How to create an enum?
03:54 - Enums under the hood
05:21 - How to change the value of the enum member?
08:07 - Casting int to an enum (Handling user input)
11:13 - Make your first program with enums (+ tips to fix bugs)
14:10 - How to iterate through enum elements?
17:06 - Enum as a function parameter
Other courses mentioned in this video:
My top 5 Visual Assist features: • My top 5 Visual Assist...
Switch-case for beginners: • C++ FOR BEGINNERS (202...
Error handling with Try-catch: • Exception handling in ...
Do-while loop: • C++ FOR BEGINNERS (202...
Add me on:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty

Пікірлер: 177

  • @CodeBeauty
    @CodeBeauty2 жыл бұрын

    📚 Learn how to solve problems and build projects with these FREE E-Books ⬇ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. Code from this video: #include using namespace std; enum EyeColor { Brown=1, Blue=22, Green=3, Gray=4, Heterochromia, Other }; void getEyeColorDetails(EyeColor myEyeColor) { switch (myEyeColor) { case Brown: cout

  • @dundyd3612
    @dundyd36122 жыл бұрын

    I love your videos Saldina, much better than any other I could find

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    🥰🥰

  • @milkamilkica1935
    @milkamilkica19352 жыл бұрын

    Yess, was waiting for this. Your videos are great!

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    enjoy! 🥰🥰

  • @ChrisVideosGreek
    @ChrisVideosGreek2 жыл бұрын

    This video is gonna be a great one!

  • @gollygobih6527
    @gollygobih65272 жыл бұрын

    I'm your biggest fan bcz your videos changed my life. I was depressed and couldn't see anything positive and interesting to do with my life until I started watching your videos. now I feel that I'm making progress every day and cant wait for every new video that you publish. love you SALDINA 🌹🌹🌹

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    I'm so happy for you and I'm sure that you'll find happiness and purpose in building great apps that will serve people and our planet for a long time to come! ❤️❤️

  • @exinangai2216

    @exinangai2216

    2 жыл бұрын

    wow, I never thought of prog tut video can help ppl with depression to engage in new activities again. Keep going, pal 😁. If programming & exploring how computers work is your thing, it is a refreshing start to get a taste of "actually living at present" (instead of burying and helplessly struggling with negative thoughts every sec). You may one day become a great programmer among the existing ones. 👍🏻Good Luck & Best wishes to you & your journey of coding. 👍

  • @phoebewell3653

    @phoebewell3653

    2 жыл бұрын

    I was in a similar situation and mine started with a breakup. I also started learning programming and going to the gym because I WANT A BETTER FUTURE for myself. I feel so much better now than just a few months ago. Now I have a purpose and goals for every day in my life. Thank you Saldina, you have a gift for this, don't ever stop, your videos will change many lives ❤️ ❤️ (ps. I also follow you on IG and love your gym stories)

  • @omleen3187
    @omleen3187 Жыл бұрын

    Your accent is so understandable and easy to follow. Thanks a million ❤

  • @umairahmad2131
    @umairahmad21312 жыл бұрын

    Please make full course on Data Structure and algorithm (DSA)

  • @ammaarsaadat8045
    @ammaarsaadat80452 жыл бұрын

    Amazing video. Didn’t get this concept when explained in college. You made it so much easier to understand. EyeColor myEyeColor = (EyeColor) 1; If (EyeColor == 1) {likeVideo();} Else {likeVideo();}

  • @akosyt4540
    @akosyt4540 Жыл бұрын

    enum EyeColor{ Brown=0, Blue, Grey, Green, Heterochromia}; int UserIput; EyeColor eyecolor; do { cout > UserIput; } while (UserIput 4); eyecolor = EyeColor( UserIput); switch (eyecolor) { case EyeColor::Brown:cout

  • @richardchinomona4676
    @richardchinomona46762 жыл бұрын

    You are appreciated. I don't think I would be able to passing my C++ module without you.

  • @user-yc4gx8eh9y
    @user-yc4gx8eh9y4 ай бұрын

    This video is a masterpiece! Congratulations, Saldina, it helped me a lot!

  • @CodeBeauty

    @CodeBeauty

    4 ай бұрын

    I'm happy to hear that 🥰

  • @-_-5070
    @-_-50702 жыл бұрын

    Thank you Saldina♥️ This was really helpful, and it's 2 btw😁

  • @l.p.1967
    @l.p.19672 жыл бұрын

    Thank you for making this video, btw, the question that you asked is 2 😁♥

  • @alec_almartson
    @alec_almartson2 жыл бұрын

    Thank you for making this video, I really appreciate it. 💯👍🏻

  • @savansanghavi7465
    @savansanghavi74652 жыл бұрын

    Your videos are better than whatever is available on KZread. Thanks for sharing ur knowledge. Please make videos about rtti

  • @peterlaidlaw8655
    @peterlaidlaw8655 Жыл бұрын

    Hi .. I'm a self taught programmer for embedded hardware .. Feeling playful; my eye colour changes with my mood - 12 today :). I came here to refresh knowledge of Static variables. BYW .. my two fav. teachers are you and David Malan (CS50) .. Thanks much.

  • @sunbreeze7354
    @sunbreeze73542 жыл бұрын

    Great job as always Saldina!

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    thank you 💕

  • @suryasudha4459
    @suryasudha4459 Жыл бұрын

    Hello dear. first answer 0 second answer 1 I have a request for you, please do videos in Qt for beginners. Your explanation is more easy and understandable to me. Thanks in advance

  • @malikmuhammadarslan9993
    @malikmuhammadarslan99932 жыл бұрын

    you are really good in teaching

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    🙏💙

  • @dandon.3667
    @dandon.36676 ай бұрын

    You make me understand every concept in c++ , I love you so much I'm so grateful🥰🥰😍😍😍

  • @WDavidCastaneda
    @WDavidCastaneda2 жыл бұрын

    Thank you CodeBeauty! ❤️👍

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    🤞❤️

  • @GiorgiBastos7
    @GiorgiBastos72 жыл бұрын

    After watching this video I finally could understand the use of enums. Thanks for sharing your knowledge. Regards from Brazil.

  • @krystianratajczyk6751
    @krystianratajczyk6751 Жыл бұрын

    You tutorials are vrey helpful, I have learnt from them a lot, Thanks!

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    🥰

  • @4theloveoflife431
    @4theloveoflife4312 жыл бұрын

    Absolutely great! Your videos are amazing. Enums still give me lots of questionnarks, but you deleted some of them! Great Videos! Keep it up! :)

  • @moodyshah007
    @moodyshah007 Жыл бұрын

    Thankyou so much! I love your videos, you explain everything so clearly and in a simple fashion. I have learnt so much from you! Thankyou!

  • @sattorjabborov2728
    @sattorjabborov27282 жыл бұрын

    I was trying to understand why we need enums in swift language, and I finally understood it from c++😅❤️❤️

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    for the same reason

  • @tvrrp

    @tvrrp

    2 жыл бұрын

    Yep. And enums in Swift are more powerful. For example you can write custom initialisation for enum that take struct as a parameter. And you can iterate throw those structs and assign enum case to itself

  • @rino19ny
    @rino19ny2 жыл бұрын

    hello. please make a tutorial for C++ range based for loop and C++ vectors.

  • @neilcampbell6026
    @neilcampbell60262 жыл бұрын

    Always good content and presentation style. I always learn things from your videos. You've asked about a complete SQL class/series a couple times--yes from me.

  • @deneristargerian6755
    @deneristargerian67552 жыл бұрын

    mine is 1 😁😁

  • @mosopefoluwaadebawojo3543
    @mosopefoluwaadebawojo35432 жыл бұрын

    I really enjoy and learn a lot from your videos. Thank you Code beauty.

  • @CSHuang-uw1lx
    @CSHuang-uw1lx5 ай бұрын

    well explaination, but I have a question, which is EyeColor is an Enum type which contains several intergers. But when declaring EyeColor myEyeColor, the myEyeColor is only a member of the EyeColor? how to realize the data structure of enum and its members and values?

  • @jaspreetahir871
    @jaspreetahir871 Жыл бұрын

    tysm for ur videos regarding programming it's helping me and ofc other's alot i'm enjoying alot :)

  • @diweiye8420
    @diweiye842010 ай бұрын

    1, your video has always been so inspiring !

  • @tullyal
    @tullyal2 жыл бұрын

    Great video - easily digested over lunch! :-)

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    you can watch this one without even typing the code and still understand how it all works 😏😁❤️

  • @emilyve
    @emilyve6 ай бұрын

    I am 1, i love your character, always watch your videos complete, even the 2,5hour videos, love it

  • @pimpmetapod7906
    @pimpmetapod79062 жыл бұрын

    My eye color is 5 which is mix of 1 & 2 & 3

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    wish I was that cool 👀🥰

  • @MostorAstrakan
    @MostorAstrakan2 жыл бұрын

    4. I've never found much use for enums, to be honest. Your example is for user interaction, but a user is never going to look up their eye color in a table and then enter a number. (It's an example, so fine). I think the main use for an enum is to make numerical codes more readable for the Programmer. For instance if you have a list of increasingly important messages, you could do: enum Severity { ignore=0, debug, info, warning, error, panic, disaster }; And then you can do things like: if(errorLevel >= error) { cout

  • @davidmorris2848

    @davidmorris2848

    Жыл бұрын

    In the video she says that enums are for the programmer and future programmers who look at the code. I don't recall her stating that they were for the user.

  • @lachichinqkocev6151
    @lachichinqkocev61512 жыл бұрын

    Hi Saldina I em a student and I studying CPP and I em a big fan of your videos can you pls. make video on CPP references pls.

  • @AndreyAntsupov
    @AndreyAntsupov Жыл бұрын

    Very good video. ( not only that, but others too ) My english is 75% equil google translate, but I'll try to get my point across ) I would like to see a mention that the enum is a global and we cannot create two enums with the same values: enum EyeColor {Blue, Green, Grey}; enum ClothColor {Blue, Red, Green}; We will get an error stating that two identical values ​​are declared ( or something similar ). But at the same time there is an enum class that solves this problem. I would also like to know what and where is more often used on large projects ? ( enum or enum class ) I also heard somewhere that it is correct to write enum values like this: enum EyeColor {BLUE, RED, YELLOW}; because these are constants, but I still don’t understand if someone is still doing this or is already “outdated” ? P.s. if (Brown == 1) { MyEyeColor = 6; } (Gray + Green)

  • @mehdipira4933
    @mehdipira49332 жыл бұрын

    Awesome, thanks.

  • @dishant5157
    @dishant51572 жыл бұрын

    Always love your teaching styles ❤️❤️❤️❤️❤️❤️❤️

  • @pankajahir9343
    @pankajahir93439 ай бұрын

    thank you so much dear ❤🎉

  • @midenno9987
    @midenno9987 Жыл бұрын

    Hallo, it is 2+3. Thanks for the effort .

  • @ScaerieTale
    @ScaerieTale5 ай бұрын

    5 (2 && 1)

  • @tuazulyrojoeljean
    @tuazulyrojoeljean11 ай бұрын

    0 0 Great video! Thank you very much, Saldina! :)

  • @colins2
    @colins22 жыл бұрын

    Quite a lot of blue-eyed programmers - me too! Why didn't you mention a default value in the switch statements? I always thought that you should, where there could be ambiguity. Great video though👍

  • @cac2244
    @cac22442 жыл бұрын

    Finally an easy to understand explanation... BTW MyEyeColor == 1;

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    👀❤️😼

  • @user-gg2ik3nz1v
    @user-gg2ik3nz1v8 ай бұрын

    i love your explanation , iam from Egypt😍😜

  • @antonnovo695
    @antonnovo6952 жыл бұрын

    Hi! You should do a java course. I'd devour it.

  • @sewingmachinesindetail
    @sewingmachinesindetail4 ай бұрын

    Thank you for nice video. In your code I saw myEyeColor++ in a for statement. I have tried to make a statement like myEyeColor++; in code, and then the compiler responds, that it is not allowed, and it surprised me. Should a C++ compiler allow this statement? Could it be allowed in C and not in C++? Is your compiler here C or C++?

  • @manoharsagunthalla9215
    @manoharsagunthalla92152 жыл бұрын

    Dear Saldana is it possible to define any number of enum and use it? For example say Group - 1 { English, Tamil, Literature etc}, Group - 2 {Math, Physics,Chemistry etc}

  • @khan-f5f
    @khan-f5f Жыл бұрын

    Hello my question is In this video enums as function parameter you just create a function of geteyeclordetail and define switch cases under it it does't related to enums if we write this function without Enum it will work or not

  • @kenopedia7023
    @kenopedia70238 ай бұрын

    I learned a lot of for your videos. Hope I will pass the exams😂😂

  • @CodeBeauty

    @CodeBeauty

    8 ай бұрын

    Good luck 🤞🤞🤗

  • @kenopedia7023

    @kenopedia7023

    8 ай бұрын

    @@CodeBeauty I have a request. Please explain checksum c++ .

  • @kenopedia7023

    @kenopedia7023

    8 ай бұрын

    @@CodeBeauty And also the different function of strings function.

  • @neepunpatil5201
    @neepunpatil52012 жыл бұрын

    Well we are close to 200k😄😄

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    Soo close 🥺 ❤️

  • @blacksky9571
    @blacksky95712 жыл бұрын

    I cannot find the translation

  • @khaledvevo603
    @khaledvevo6035 ай бұрын

    Thank You So Much

  • @moexii6308
    @moexii6308 Жыл бұрын

    You're awesome girl!!

  • @Mrclean101
    @Mrclean101 Жыл бұрын

    int userInput; do { coutuserInput; }while (userInput6);

  • @mahmoudhamdy4252
    @mahmoudhamdy4252 Жыл бұрын

    My Eye color is 1 😃 thanks for the video

  • @user-rg9hr9gf2t
    @user-rg9hr9gf2t Жыл бұрын

    EyeColor myEycolor = (EyeColor) 6; Although I'm not sure if cast will work with Rvalue.

  • @xthanatos89
    @xthanatos898 ай бұрын

    take my follow also 1 is mine!

  • @ethangold4900
    @ethangold49002 жыл бұрын

    As a computer science student, I realized the importance of enums when I revisited one of my projects after months

  • @superboy3625
    @superboy36252 жыл бұрын

    Hello... pls post videos on c++ stl. Standard template library.. Your videos are great ..🥳

  • @heltondeoliveirarodrigues5726
    @heltondeoliveirarodrigues57264 ай бұрын

    EyeColor=1

  • @passiondono4692
    @passiondono4692 Жыл бұрын

    as of 8:05 My eye color is ... Eyecolor myEyeColor = Other; std::cout

  • @admoonhermiz1
    @admoonhermiz12 жыл бұрын

    thank you!!!

  • @supportitservices6349
    @supportitservices6349 Жыл бұрын

    Thank you beuty

  • @lmnefg121
    @lmnefg121 Жыл бұрын

    I just love this one~!

  • @Timo-Epis
    @Timo-Epis Жыл бұрын

    isn't "enum class" more appropiate to use?

  • @rcookman
    @rcookman2 жыл бұрын

    I have brown eyes too. Lovely brown eyes like yours :) Also enums are great thanks for sharing.

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    👁️ 👁️ 🤎

  • @ornessarhithfaeron3576

    @ornessarhithfaeron3576

    2 жыл бұрын

    👁️👄👁️

  • @kwenjieeohrengsoc987
    @kwenjieeohrengsoc9872 жыл бұрын

    Thanks

  • @arjunpoudel6715
    @arjunpoudel6715 Жыл бұрын

    can you make video for Qt for mac os

  • @gregorykinney8504
    @gregorykinney85048 ай бұрын

    Very Helpful. 2

  • @osamahukel8858
    @osamahukel88582 жыл бұрын

    I am really so grateful for Allah then you . Because you really help me in c++ . A lot.

  • @barimahyaw5446
    @barimahyaw54462 жыл бұрын

    Can saldina create a platform like discord where we can ask questions

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    yess, that will be soon 💜 🙈

  • @barimahyaw5446

    @barimahyaw5446

    2 жыл бұрын

    Okay you've really helped me alot and I'm looking forward to it

  • @darkplayer4371
    @darkplayer43712 жыл бұрын

    Can you please make videos on microcontroller programming For beginners If yes please reply so we will wait otherwise you understand 😃😊

  • @jeetenzhurlollz8387
    @jeetenzhurlollz83874 ай бұрын

    she made unreal easy

  • @us07251
    @us072512 жыл бұрын

    ERROR: My eye color is black :(

  • @shukurullomeliboyev2004
    @shukurullomeliboyev2004 Жыл бұрын

    my eyes are blue -gray😁.

  • @MsSemki
    @MsSemki3 ай бұрын

    4

  • @CodeBeauty

    @CodeBeauty

    3 ай бұрын

    😍

  • @__hannibaalbarca__
    @__hannibaalbarca__ Жыл бұрын

    Did you know i never used; or very rare; Instead I used const binary arrray

  • @TheMonkySpanker
    @TheMonkySpanker2 жыл бұрын

    6

  • @Selinzik_CEO
    @Selinzik_CEOАй бұрын

    5...

  • @user-vt3mc3np9r
    @user-vt3mc3np9r2 жыл бұрын

    1

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    👀😁❤️

  • @thepoloski3498
    @thepoloski34982 жыл бұрын

    hello can you help me Im trying to make a code that will decode numbers and this is what I have so far im getting errors and im not sure why #include using namespace std; int main() { int 1, 2, 3, 4, 5,; cout > 1 >> 2 >> 3 >> 4 >> 5; cout

  • @tuliosilva6720
    @tuliosilva6720 Жыл бұрын

    My eye color: 1 ^^

  • @Timo-Epis
    @Timo-Epis Жыл бұрын

    Everyone seems to have their own way formating enumerators lol

  • @sulfur32066
    @sulfur320662 жыл бұрын

    2

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    🤞😁 ❤️

  • @likami6830
    @likami68302 жыл бұрын

    My eye color is 2 :)))

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    😁❤️

  • @johnromero1537
    @johnromero15372 жыл бұрын

    My eye color is 1. By show of hands or thumbs up, who else likes the way our hostess says "parameter"?

  • @glebignatski15
    @glebignatski152 жыл бұрын

    Green

  • @marichka5992
    @marichka5992 Жыл бұрын

    5

  • @awakened999
    @awakened9992 жыл бұрын

    0

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    😁👀❤️

  • @Austin-pw2ud
    @Austin-pw2ud2 жыл бұрын

    Gooodddddd,,,,,how is she sooo cute and Smart at the same time!!!!

  • @shivammavi824
    @shivammavi8242 жыл бұрын

    9

  • @illia4658
    @illia4658 Жыл бұрын

    Color of my eyes is 1

  • @deep_feelinn
    @deep_feelinn2 жыл бұрын

    Other, Black

  • @CodeBeauty

    @CodeBeauty

    2 жыл бұрын

    👀❤️

  • @phynx-victumterra652
    @phynx-victumterra6522 жыл бұрын

    #2 :)

  • @SavageScientist
    @SavageScientist2 жыл бұрын

    my eye==1

  • @adrianluck8689
    @adrianluck86895 ай бұрын

    my_eye_colour = 0;