ENUMS in C++ explained easy 📅

  Рет қаралды 20,502

Bro Code

Bro Code

Күн бұрын

#enums #enumerations
Enums C++ tutorial example explained

Пікірлер: 43
@BroCodez
@BroCodez 2 жыл бұрын
#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
@higiniofuentes2551
@higiniofuentes2551 Жыл бұрын
Thank you for this very useful video!
@higiniofuentes2551
@higiniofuentes2551 Жыл бұрын
Is possible to create an enum variable with variables inside? Like a dynamic enum! Thank you!
@rameezalipacific
@rameezalipacific Жыл бұрын
F
@DetCoAnimeFan
@DetCoAnimeFan 2 жыл бұрын
Oh my, visited this channel after a while and so much new content to watch! GREAT!
@mvisperas
@mvisperas 4 ай бұрын
The one thing I found out about enums is that you cannot use an identifier that already exists. For example: enum Day {sunday = 0, monday = 1, tuesday = 2, wednesday = 3, thursday = 4, friday = 5, saturday = 6}; enum WorkDay {monday = 1, tuesday = 2, wednesday = 3, thursday = 4, friday = 5}; Even if you change monday in Workday to 0, it will not compile. Just something to remember.
@JackEvans-hf7qt
@JackEvans-hf7qt Жыл бұрын
//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
@stith_pragya
@stith_pragya 7 ай бұрын
Thank You So Much for this wonderful video............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@kuyaminn597
@kuyaminn597 6 күн бұрын
//thank you for this video. enum studentType {FRESHMAN = 0, SOPHMORE = 1, JUNIOR = 2, SENIOR = 3};
@SurajDas-zi7wb
@SurajDas-zi7wb 2 жыл бұрын
thanks you so much for the lecture 💜 eagerly waiting for oop leacture :)
@Dazza_Doo
@Dazza_Doo 2 жыл бұрын
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.
@Henry-sv3wv
@Henry-sv3wv 13 күн бұрын
yea, but C# is that microsoft language and i use Linux
@akielstewart-r3b
@akielstewart-r3b 3 ай бұрын
Gonna use this to try making a snake game. This explanation was great.
@Lil--E
@Lil--E 3 ай бұрын
Very helpful and clear. Thank you.
@NotMarkKnopfler
@NotMarkKnopfler Ай бұрын
Enums make more sense when used with the scope resolution operator. So instead of int day = saturday; I would use int day = Day::saturday; Without it you may as well use variables or #defines.
@Henry-sv3wv
@Henry-sv3wv 12 күн бұрын
use enum class if you don't want trouble
@paulinek106
@paulinek106 Ай бұрын
could you explain the differences between arrays and enums. Im beginner and for me it is kinda similar
@offlakom2251
@offlakom2251 Ай бұрын
Array => Day[2] Enum=> Day::mon
@charan_0086
@charan_0086 Ай бұрын
enums are similar to arrays but we can modify indices
@Dazza_Doo
@Dazza_Doo 2 жыл бұрын
enum SheSaid {big = 7, small = 6, thin = 1, skinny = 0, oh-no = 10, get-out-of-here = 100};
@baconheadhair6938
@baconheadhair6938 3 ай бұрын
do you love me i told her only parter
@jazztiger07
@jazztiger07 2 ай бұрын
@@baconheadhair6938 I only love my bed and my mama im sorry
@nawaftahir7060
@nawaftahir7060 Ай бұрын
i got the concepts now ;)
@SawyerCarlson-h6f
@SawyerCarlson-h6f 2 ай бұрын
enum Family { yourself = 18, dad = 58, mom = 60, brother = 21, sister = 19 }
@MarwanNasser-c5b
@MarwanNasser-c5b 5 ай бұрын
enum person{ahmed=0,hossam=1,anas=2,khaled=3};
@KrittapasPuangmaha
@KrittapasPuangmaha 6 ай бұрын
Thank you
@hortusdeescapismo
@hortusdeescapismo 3 ай бұрын
how does this 4 month vid have comment from 2 years ago
@PCgamers69420
@PCgamers69420 3 ай бұрын
enum Month {January, February, March, April, May, June, July, August, September, October, November, December};
@Henry-sv3wv
@Henry-sv3wv 12 күн бұрын
January=1, February, March, ... to make the numbering start with 1 and not 0
@notmidhun2365
@notmidhun2365 3 ай бұрын
so do enum and struct does the same things basically?
@serfyboi23452
@serfyboi23452 2 ай бұрын
kinda but not really it works alot like an array if that makes sense
@Abhishek-m3o9v
@Abhishek-m3o9v 9 ай бұрын
have one doubt, how to use enums in arithmetic operations?
@mvisperas
@mvisperas 4 ай бұрын
Enums are used as selector. The advantage of enums is the code is more readable. Instead of: if (Day == 0) // user doesn't need to figure out what 0 means. Better: If (Day == sunday)
@Henry-sv3wv
@Henry-sv3wv 12 күн бұрын
enum sucks, use class enum
@snajper4141
@snajper4141 6 ай бұрын
And what about enums in classes?
@Henry-sv3wv
@Henry-sv3wv 12 күн бұрын
enum sucks, use enum class
@ThisL1ght
@ThisL1ght Жыл бұрын
enum Variables{integer, boolean}; Other variables didn't work
@mhmwoodar2678
@mhmwoodar2678 4 ай бұрын
enum afterVideo {Like, coummt, like and coummt}
@chinno06
@chinno06 4 ай бұрын
I love pizza day haha
@iteaahorma
@iteaahorma 2 ай бұрын
😂😂❤❤❤❤❤❤❤
@danaildoganov
@danaildoganov 10 ай бұрын
#include enum player {Messi, Ronaldo, Neymar, Ronaldinho, Suarez, Stoichkov}; int main() { player best = Ronaldinho; switch(best){ case Messi: std::cout
C++ CLASSES & OBJECTS explained easy 🧍
10:54
Bro Code
Рет қаралды 51 М.
C++ Tutorial:  enumerated data types [enums]
16:38
Professor Hank Stalica
Рет қаралды 2,6 М.
Делаем с Никой слово LOVE !
00:43
Привет, Я Ника!
Рет қаралды 4,5 МЛН
New Colour Match Puzzle Challenge - Incredibox Sprunki
00:23
Music Playground
Рет қаралды 44 МЛН
Drink Matching Game #игры #games #funnygames #умныеигры #matching #игрыдлякомпании #challenge
00:26
C++ structs as arguments explained 🚚
5:29
Bro Code
Рет қаралды 14 М.
What are Enums in Python?
5:33
Boot dev
Рет қаралды 6 М.
you will never ask about pointers again after watching this video
8:03
ENUMS in C++
7:45
The Cherno
Рет қаралды 403 М.
STRUCTS in C++ explained 🏗️
5:01
Bro Code
Рет қаралды 43 М.
Всё об указателях в C++ за 20 минут
20:00
What are C++ namespaces? 📛
4:37
Bro Code
Рет қаралды 53 М.
CLASSES vs STRUCTS in C++
8:32
The Cherno
Рет қаралды 487 М.
Pointers and dynamic memory - stack vs heap
17:26
mycodeschool
Рет қаралды 1,5 МЛН
Enumerations in C
6:46
Neso Academy
Рет қаралды 186 М.
Делаем с Никой слово LOVE !
00:43
Привет, Я Ника!
Рет қаралды 4,5 МЛН