Thank you, you scared me! Actually there is still a lot of books being printed for C programming. I believe the Mars shuttle mission was controlled by 30000 pages of code……all written in C…..not C++.
And this is really good then, say…in a switch statement. Since you have to switch on an integer (or an expression that evaluates to an integer), then you can switch on one of the enum values. LIke this:
void printPhrase(season s) {
switch(s) {
case summer:
It’s good for representing items. For instance, let’s say that you’re making a game and the weapons in the game are as follows: knife, pistol, shotgun, sniper. Well it doesn’t make sense really to store the weapon the player’s using as a string, so you’d store it as an enum value.
Another interesting thing to note is if you go over the bounds of the enum, for example calling printPhrase(10) in this video (assuming that these are numbered 0…3) it just prints out the last value in the enum without throwing some type of error, so again in this video, it would be spring
Hey I am using c++ visual basic and i can get it to print one of the phrases by putting a number inside the brackets in the main…?? but it Works fine if i type one of the seasons
Please don’t say that…..C is still very valid. I am very, very retarded and have worked very hard to learn C…..I am now as competent as a dumb 3rd grader. C++ is just a cheap, bullshit ripoff.
First of all, one of the best tutorial playlists on Youtube and thank you so much for it. Later on what if i want to check user’s answer. I created this:
char Input;
printf(“Which season is in there ?n”);
scanf(“%s”, &Input);
printSeason(Input);
Rest of the code is an exact copy of yours. But it doesn’t work. It runs and i give an input but than nothing happens. Anyone has any idea ?
it gives me a compilation erro when i call the method print: argument of type int is incompatible with parameter of type “myEnum”. Please someone explain.
nah I take my words back. C is still very widespread for scientific programming, embedded systems etc. Linux is written in C.
C++ is not a ripoff, its object oriented, has classes, templates etc. Both are great languages, I’d say THE best. So yea, C/C++ forever!
Excellent!
Could you tell me what software you’re using as your C editor please?
Thanks, loving that built in compiler.
thx dude
good job thank you
Thank you, you scared me! Actually there is still a lot of books being printed for C programming. I believe the Mars shuttle mission was controlled by 30000 pages of code……all written in C…..not C++.
And this is really good then, say…in a switch statement. Since you have to switch on an integer (or an expression that evaluates to an integer), then you can switch on one of the enum values. LIke this:
void printPhrase(season s) {
switch(s) {
case summer:
etc…
thanks
UNBELIEVABLE……a C video
Best explanation video i’ve ever seen of any programming tutorial. Very descriptive and clear, and tons of examples shown. Thank you so much.
Thanks for the video on enum. Video help me understand the topic.
Your a great teacher. Keep it up
It’s good for representing items. For instance, let’s say that you’re making a game and the weapons in the game are as follows: knife, pistol, shotgun, sniper. Well it doesn’t make sense really to store the weapon the player’s using as a string, so you’d store it as an enum value.
UNBELIEVABLE……a C video in English!!!!!!!!
I just love the way you say “Yep, perfect” 😀
Another interesting thing to note is if you go over the bounds of the enum, for example calling printPhrase(10) in this video (assuming that these are numbered 0…3) it just prints out the last value in the enum without throwing some type of error, so again in this video, it would be spring
Awesome, Thanks!
Hey I am using c++ visual basic and i can get it to print one of the phrases by putting a number inside the brackets in the main…?? but it Works fine if i type one of the seasons
One question Adam: Why “else if (s == spring)” ?
Are there any other seasons you’ve left out? Why not use “else” for the last control arm? 😉
Adam i dont get what is enum good for?
thank you so much!
Please don’t say that…..C is still very valid. I am very, very retarded and have worked very hard to learn C…..I am now as competent as a dumb 3rd grader. C++ is just a cheap, bullshit ripoff.
THANK YOU!
First of all, one of the best tutorial playlists on Youtube and thank you so much for it. Later on what if i want to check user’s answer. I created this:
char Input;
printf(“Which season is in there ?n”);
scanf(“%s”, &Input);
printSeason(Input);
Rest of the code is an exact copy of yours. But it doesn’t work. It runs and i give an input but than nothing happens. Anyone has any idea ?
yup perfect!! * 1000000
good tutorial!!
omg! amazing tutorial, I’ve been using enums in my microcontroller project without understanding its syntax, it confused me a lot. but now i get it 😀
Thank you so much…your demonstration is better than a book!
it gives me a compilation erro when i call the method print: argument of type int is incompatible with parameter of type “myEnum”. Please someone explain.
great vid very clear
Excellent video!
Thanks!!
nah I take my words back. C is still very widespread for scientific programming, embedded systems etc. Linux is written in C.
C++ is not a ripoff, its object oriented, has classes, templates etc. Both are great languages, I’d say THE best. So yea, C/C++ forever!