nearly punched my computer if it wasn't for you, thanks for saving me $$$
@mytech67792 жыл бұрын
Fall through is actually the more useful feature of switch, eg if condition X requires actions 1,2,3 ; Y requires 2 and 3 ; and Z only needs 3. And you are not limited to integer cases, it will accept enumerable types. As with many things in life, just because you can't find the value in something doesn't mean that it doesn't have value to someone else. And this part is speculation as I haven't tested; but I can see the way that switch acts more like a lookup table rather than accepting complex expressions is likely a big performance advantage over complex if statement structures which require inline evaluation at every level. Sort of analogous to compiled verses interpreted source code.
@WalkthroughCentral105 жыл бұрын
Excellent videos! Keep it up man!
@Sapphireeyes1044 жыл бұрын
I was curious so I looked, and switch cases are pretty much identical in Game Maker Language. I haven't gone over switch cases in class yet, but I already knew what they functionally did. I wanted to peek ahead and see how complicated it was later, and then I got curious and looked at the GML equivalent.
@olliveraira61224 жыл бұрын
How do you fetch enums name as string?
@guitarhax74125 жыл бұрын
Boom, next!
@SweaterSwagg4 жыл бұрын
Great tutorial, thank you!
@8kigana5 жыл бұрын
Caleb are you using visual studio code c++? I asked because I don't know how to run it even after I installed it.
@johnnikay33593 жыл бұрын
When I do this, I can only access the option that is initialized at the top (Season::Winter).
@PunmasterSTP3 жыл бұрын
Did you write code in any of the other cases?
@sergiorome422 жыл бұрын
the amount of times he said integrals :( bruh its integers
@Artem_Kichaev27229 ай бұрын
Ya, that bothered me too😂
@deviltube62053 жыл бұрын
is it possible to take the case as input by user using cin>>Season?
@Norogoth4 жыл бұрын
How the hell are you the guy who does the big Oracle series AND this?
@Norogoth4 жыл бұрын
This question is NOT rhetorical.
@42norbert5 жыл бұрын
Celeb Curry is very close to 'Howard - Curry ' ;)
@alexissuarezalvarez56224 жыл бұрын
hi, how come c ++ can interpret the word "season"?
@Austin19904 жыл бұрын
Because he is defining it as an enumeration, like how C++ would recognize names of classes that you create.
@oengkimsour8123 жыл бұрын
Thanks youu so much
@tejjmk5 жыл бұрын
could you still use switch case with enums when you're using a buffer and were comparing. For example if ((commandBuffer.compare(0, endOfVerb, "north") == 0) || (commandBuffer.compare(0, endOfVerb, "n") == 0)) right now i've got to do for all directions and it's a bit repeated
@engineeringjoe5 жыл бұрын
Which ide is this?
@furiosarana18575 жыл бұрын
Technically it is just an editor called Visual Studio Code, not Visual Studio (without the Code) which is an IDE for C++. It is an open-source editor that allows for ide-like functionality with extensions you can install for almost every language. I can highly recommend it and prefer it over more feature rich but more complex IDE's like Visual Studio, Eclipse... . If you depend on refactoring a lot, VS Code might not be optimal. PS: the theme is called Solarized Light and i love it. Edit: Also has great SCM (Source Control Management = Git(Hub)...)
@funwithaiman5 жыл бұрын
Hey Furiosarana! Thanks for the suggestions.
@erikhicks61842 жыл бұрын
This isn't Bucky??
@galihtanu3 жыл бұрын
You make it simple. 👍
@charlesmullen80243 жыл бұрын
9:05 lol
@FranklinGaming235 жыл бұрын
You should use the header file #include so you can just type cout
@julioflores18495 жыл бұрын
FranklinGaming using namespace std; Is what you want
@iluvyunie4 жыл бұрын
@Bo Bob I like this one, it's more specific so you don't just include a crazy amount of predetermined names, and basic programs only really need std::cout, cin, string etc
@a999g214 жыл бұрын
@Bo Bob when there are lots of namespaces being used, it can clarify. Say there was a namespace called orange and a namespace called pear. If both had a function called print, how would you know which was being executed. This would be fixed by always saying things like pear::print ect.
@iluvyunie4 жыл бұрын
@Bo Bob a namespace is (I may be wrong here) a set of preprocessor statements that prefix your code to tell the compiler what library your language is coming from? As in I could create a namespace inside a header file called poop and in order to call functions from my poop I'd have to type everything as poop::whateverIcalledthefunctionImadeinsidethepoopheader So std:: is just a set of instructions a lovely bunch of people cooked into what we call the standard library. I'm sure someone could explain this way better but yeah, that's my understanding. It's just to tell the compiler where the words you're typing in there are defined, because in c++ every little detail has to be outlined properly to work.