Тёмный

CLASSES in C++ 

The Cherno
Подписаться 650 тыс.
Просмотров 661 тыс.
50% 1

Twitter ► / thecherno
Instagram ► / thecherno
Patreon ► / thecherno
Series Playlist ► • C++
BEST laptop for programming! ► geni.us/pakTES
My FAVOURITE keyboard for programming! ► geni.us/zNhB
FAVOURITE monitors for programming! ► geni.us/Ig6KBq
MAIN Camera ► geni.us/t6xyDRO
MAIN Lens ► geni.us/xGoDWT
Second Camera ► geni.us/CYUQ
Microphone ► geni.us/wqO6g7K
Slack ► slack.thecherno.com
Stream ► / thecherno
Website ► www.thecherno.com
Facebook ► / thecherno

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 403   
@huntersan9
@huntersan9 7 лет назад
I can't stop looking at the chicken.....
@Maruf-zt7dz
@Maruf-zt7dz 5 лет назад
same
@muhammadasmar7846
@muhammadasmar7846 5 лет назад
i cant unsee that now...
@georgeconstantinides1947
@georgeconstantinides1947 5 лет назад
lol I didn't even notice it
@xuqiangzhang9724
@xuqiangzhang9724 5 лет назад
lol
@sing759
@sing759 4 года назад
the same here
@electronix259
@electronix259 6 лет назад
Each of these 10 minute videos teach me more than one class
@themanwhich123456
@themanwhich123456 4 года назад
fuck yeah.
@CupOfWhiskey
@CupOfWhiskey 4 года назад
No joke, I learned more in two videos 16min total than I did in my 2hr class
@timeflies98
@timeflies98 3 года назад
glad I'm not the only one
@michaelnolan8719
@michaelnolan8719 3 года назад
Professor Xing ain't got nothing on Cherno, Easy A for data structs. ;)
@pierfrancescopeperoni
@pierfrancescopeperoni 3 года назад
True, you can play videos faster on RU-vid.
@xyz8206
@xyz8206 4 года назад
3:43 'variables that are made from class types are called objects' this line just made everything so much easy. Thank you.
@nikhilgarg27
@nikhilgarg27 Год назад
Agreed with you 100%
@zzzMrgamerzzz
@zzzMrgamerzzz 5 лет назад
Never in my Uni days have I seen such a good youtube tutor. Clear, succinct and everything seems so much simpler
@serkanozturk4217
@serkanozturk4217 Год назад
Personal notes: -Members are private by default -Classes allow us to group variables into a user-defined type and also add functionality to those variables
@goodvibes7304
@goodvibes7304 7 месяцев назад
And those functions are called methods inside the classes.
@oquaika-qua3043
@oquaika-qua3043 4 года назад
Coming from a C background and just learning C++, I have had so many people try to explain the concept of classes, but until watching your video I have never fully understood it. Thank you so much.
@rzmadzore
@rzmadzore 2 года назад
same here, what a relief
@colorlord98
@colorlord98 7 лет назад
Still waiting for that video on the back of a kangaroo!
@ToxicityGameDev
@ToxicityGameDev 6 лет назад
Soooooo.... Udemy ads keep playing on these videos telling me to sign up for a C++ course on there... Pfff, wrong place to advertise guys lmao.
@Gilpow
@Gilpow 6 лет назад
Sure, because clearly you're going to learn a lot by using a single source, right?
@timmoth_j
@timmoth_j 6 лет назад
Using an adblocker will stop the Cherno from earning money from these videos, regardless of how smug and annoying the Udemy guy is I still choose to watch the adverts to support the Cherno.
@Gilpow
@Gilpow 6 лет назад
Timothy Jones Yup, it's the least we can do, if we can't support him on Patreon.
@batabatonica
@batabatonica 6 лет назад
They are spamming me python and html, but i watch them anyway to help Cherno
@ToxicityGameDev
@ToxicityGameDev 6 лет назад
@Gilpow, really dude... you take all of life so serious? @Dany na, I prefer to help him get those pennies that stack up from the ad views ;-)
@faizalimuhammadzoda4731
@faizalimuhammadzoda4731 6 лет назад
I like the way you explain things: very simple, very fast and most importantly-nothing outside the topic. Thanks.
@mtareen
@mtareen 4 года назад
I wish learning C++ was this easy. Having worked in C++ for 8 years in the past, it takes a long time to understand these concepts
@leixun
@leixun 4 года назад
*My takeaways:* Class is a way to group data and functionalities together 0:55
@rasta6332
@rasta6332 3 года назад
looking for your comment and found it... I hope you have a summary of all the upcoming videos in the playlist.
@leixun
@leixun 3 года назад
Rasta Thanks, I did write summary for most videos in the playlist, but some of them are more complete than others :)
@Aditya-zl8sn
@Aditya-zl8sn 3 года назад
commenting for visibilty
@mukundchandrahasan5890
@mukundchandrahasan5890 5 лет назад
Just came by to learn more from my University C++ class, and I got to say I love how your video is succinct and concise. No extra flowery wording, just straight to the point. But you do so in a way where we can understand, so you have that perfect sweet spot in teaching. Appreciate it, and I'm glad I came across your channel.
@zes3813
@zes3813 3 года назад
wrgg, no such thin gas extra or succx or concisx or point or etc, say, can say infix any nmw and any s perfect
@biqbicle4982
@biqbicle4982 Год назад
@@zes3813 ??
@nortski78
@nortski78 4 года назад
I'm so glad you decided to ease up on the music, it makes it so much easier to concentrate on what you're saying.
@jaidev2717
@jaidev2717 3 года назад
Can't appreciate this series enough..excellent job...Best things is your videos aren't boring like other programming videos. Keep it up man. May god bless you.
@yahiashams2334
@yahiashams2334 3 года назад
So a class is essentially a struct that can have functions.
@crashtagiyevpirt
@crashtagiyevpirt Год назад
​@Artem Katerynych And Struct is in Stack andClasses in Heap
@SkeletonSSBM
@SkeletonSSBM 3 года назад
Thank you so much! Simple and to the point, yet has great explanations for the things he's doing. Nice work!
@FlooferLand
@FlooferLand 3 года назад
1:42 "You can probably start to *C* that this is getting a little bit messy" and that relates to how C doesn't have classes lmao
@akberalikhan4659
@akberalikhan4659 4 года назад
Explained it quickly and clearly. Saved me a lot of time. Thanks!
@rachidajewher8649
@rachidajewher8649 3 года назад
i like the way you are teaching people you are explaining everything in a higher speed you get the global vision of the subject instantly
@Ferocious_Imbecile
@Ferocious_Imbecile 2 года назад
It's always a relief to find somone that makes an impermiable thicket of jargon become meaningful.
@rcookie5128
@rcookie5128 7 лет назад
Structs could have been mentioned as well in this video I guess, but not necessarily. Great job, as always! now to the other columns of OO programming! :)
@danielrousseau6541
@danielrousseau6541 5 лет назад
This kind of format is definitely better for both teaching and learning.
@ezert_13
@ezert_13 5 лет назад
I'm sure I'll recommend this course for a lot of people in the future! : D
@skayland
@skayland 3 года назад
Wow that was super simple and well explained. i think I'm gonna watch the whole series now lol
@dildarsk246
@dildarsk246 6 лет назад
Cherno becomes teacher. 100% boys' attendance. *200%* girls' attendance. *H a n d s o m e*
@amndrkwe
@amndrkwe 4 года назад
Michael O'Connell if you count us it would be probably 500%
@essmunson
@essmunson 3 года назад
@@amndrkwe agreed
@RoySATX
@RoySATX 3 года назад
More like 110% boys attendance, I know I'd be auditing this course
@iamtrash288
@iamtrash288 3 года назад
Shadow clone no jitsu
@suntzu1409
@suntzu1409 3 года назад
Gaes: ( ͡° ͜ʖ ͡°)
@jmac217x
@jmac217x Год назад
In 3 min you've explained classes better than anyone and with examples of references too kudos
@bayroncastillo7653
@bayroncastillo7653 5 лет назад
you are so good at explaining , thank you
@Hydro1738
@Hydro1738 5 лет назад
Dude, your explanations are really impressive ... I like your KISS approach ...
@streetfighteryamahar178
@streetfighteryamahar178 5 лет назад
Very clear and understandable video with relevant examples. Thank you.
@nemanjakatava4735
@nemanjakatava4735 3 года назад
found your tutorials very useful, well done
@accessdenied9393
@accessdenied9393 2 года назад
Or more simply, we can declare the move function inside the class and define it outside the class. class Player { public: int x, y; float speed; void Move(int xa, int ya); }; void Player::Move(int xa, int ya) { x += xa * speed; y += ya * speed; } int main(void) { Player player; player.x = 1, player.y = 2; player.speed = 3.4; player.Move(1, 2); }
@autumnleaf8483
@autumnleaf8483 3 года назад
This is like Roblox Studio Development where everything has a classname, with its own functions! Thanks for the tutorials! I am loving it!
@emilycs8823
@emilycs8823 2 года назад
These videos make these concepts so simple. I learn more from them than my professors lectures , and college c++ textook.
@christophersheppard3249
@christophersheppard3249 3 года назад
Wow, in 8 minutes you managed to teach me better than my actual cs teacher.
@minecetinkaya5763
@minecetinkaya5763 7 месяцев назад
Perfect!!!!! How could you explain so simple. I read and watched videos but this is the most understandable way of this topic. Thank you so much.
@mohit7717
@mohit7717 4 года назад
thank u so much for providing this c++ series .
@calecacciatore5422
@calecacciatore5422 5 лет назад
Hey Cherno, trying to get back into the programming world, a few questions popped into my head : what do you think about Data Oriented Design (vs. Object Oriented) ? How effective can one use and understand DOD vs OOP ? or should i just stick to procedural kind of programming, that is, use C++ only where needed and mostly stick to C ? I want to be able to understand the computer and what it is doing for performance reasons. What s the speed difference in those applications between the two designs ? there s just not many resources around to poke into.
@vidyutphagetra3804
@vidyutphagetra3804 3 года назад
you have a gift of explaining things precisely and without all the bullshit
@r0_
@r0_ 4 года назад
This is the best explanation i've seen. every video/tutorial didn't help me. i tried for a few months but this is the only one i consider good
@simon39wang43
@simon39wang43 2 года назад
This vid is sooo helpful, so clear, so efficient ❤️
@rando521
@rando521 10 месяцев назад
you are extremely coherent and i love it.
@nafimulyo9739
@nafimulyo9739 Год назад
such a great video. i am beginner and i still understand all of the stuffs that you teach to us! Well done! Thanks :D
@chastitywhiterose
@chastitywhiterose 4 года назад
I've done many hobby programming projects over the years and yet I've stuck with C and never used object oriented features. However I have seen this and other examples of how it can allow doing the same things I'm doing in a lot less code. I'm doing graphics programming and so an image class makes sense as each image will have its own pixel array and width and height.
@marshalstewart7776
@marshalstewart7776 5 лет назад
Super helpful!!! Love your videos!!!!
@bencilbusher5070
@bencilbusher5070 3 года назад
it wasn't until I watched this video did I finally understand exactly why OOP is easier. thanks to juxtaposing the function straight to the class function.
@aideenfay3055
@aideenfay3055 6 лет назад
Thank you so much
@user-kb3zt3cv9s
@user-kb3zt3cv9s 7 месяцев назад
this video really helped me understand Classes in C++ thanks cherno♥
@cheako91155
@cheako91155 5 лет назад
C also has objects these are singular, structures, and arrays. Any of them could hold a pointer to a function and when u call a function through such a pointer that's exactly when things transition into OOP.
@PythonisLove
@PythonisLove 2 года назад
youtube sucks, it didn't recommend your video, while I was actually learning c++, now it's again making things interesting!
@gdubs210
@gdubs210 2 года назад
I learned so much from this video, the confusion and worry I had is gone.
@fsk648
@fsk648 7 лет назад
You kinda look like Luke Steele from Empire of the Sun, you even have the same nationality. Keep up these golden tutorials man.
@pewpew4663
@pewpew4663 7 лет назад
For a split second I thought there was a real chicken behind you just chillin there.
@mojosace
@mojosace 5 лет назад
Genius. Learned more in this than in one whole lecture with my awful professor
@TerranIV
@TerranIV 2 года назад
Thanks for this great overview!!!
@user-xg2bp5kq9t
@user-xg2bp5kq9t 9 месяцев назад
Great lesson! Thank you!
@sidharthsk84
@sidharthsk84 Год назад
really helpful and resourceful.
@azriel__
@azriel__ 8 дней назад
MAN I LOVE THE CHERNO
@mustafaglnr8780
@mustafaglnr8780 5 лет назад
Any thought you have, to build up an episode relative with Polymorphism ? if no, please ...
@dalyzee
@dalyzee 6 лет назад
You just earned a sub.
@Rose_Harmonic
@Rose_Harmonic 3 года назад
my brain is exploding with understanding and I am very excited.
@chalkchalkson5639
@chalkchalkson5639 7 лет назад
"there is nothing you can do with classes you couldn't do without them" Yeah, C is turing complete and doesn't have classes, but so is assembly or colouring squares on a piece of paper... Just because you could technically do all the same things doesn't mean that anyone on earth is actually capable of doing so :P
@FalconGames109
@FalconGames109 7 лет назад
C still has things like structs, function pointers, etc. that can accomplish any OOP stuff in about the same amount of code. As opposed to, e.g. templates, which have no real correspondence with any C features.
@zfolwick
@zfolwick 3 года назад
You can actually define classes in C. But why would you want to? It important to know in legacy codebases
@suntzu1409
@suntzu1409 3 года назад
( ͡° ͜ʖ ͡°)
@roja
@roja 2 года назад
Commenting for your exposure. The best channel on RU-vid for C++ !!!
@primalpimmy
@primalpimmy 5 лет назад
You sir, deserve more Subs.
@MrHaggyy
@MrHaggyy Год назад
There is one thing that classes do automatically for you that's quite hard and not fully achievable by C. And that's typesafety at compile time. You can typedef structs in C, but you can walk around the typecheck by accident or on purpose. C++ on the otherhand will always give you an compile error if you work with object's of different types, unless you provide a function or overwrite an operator that gives meaning to that combination of types.
@mardiyonghasben1619
@mardiyonghasben1619 9 месяцев назад
thanķ you sir....and godbless you...give all human education about and learn programming c++...thank you
@AlbertoRivas13
@AlbertoRivas13 4 года назад
Great explanation fam thanks a lot
@javand86
@javand86 2 года назад
So easily understandable. Subbed
@youssofprogrammer7546
@youssofprogrammer7546 Год назад
you are amazing man
@user-tp3ux1qy8w
@user-tp3ux1qy8w 8 месяцев назад
Thank you for simplifying classes for me in c++
@jandynotaloca
@jandynotaloca 4 года назад
thank you so much, every other video doesn't explain it thoroughly.
@sacredgeometry
@sacredgeometry 3 года назад
C# is most certainly not just OO anymore its definitely well seated as a multi-paradigm language and has been for many years. With things like ReactiveX you have data-flow, with LINQ you have functional, both are those are heavily declarative but c# is obviously also heavily imperative, reactive is data driven but async/await sand the TPL is task driven, it has very mature reflection it can easily be written procedurally. It is basically the programming language equivalent of what English is to spoken language. It takes good ideas, finds really robust implementations and then improves on them.
@shrikant_paliwal
@shrikant_paliwal 2 года назад
Bohot hi Pyara Explanation. (Really Nice Explanation of the concept). Thank You
@shaikarshad9670
@shaikarshad9670 6 лет назад
awesome teaching bro....
@alang117
@alang117 7 лет назад
I've been watching this series since the first video and I have a question. I have been learning java and now want to start 2d game development with it but the thing is I don't know how to start. Is it right to look at videos online and copy their code to make your own games with it or is it better to solve it on your own and write your own code without looking at peoples tutorial.
@gurjindersingh3843
@gurjindersingh3843 4 года назад
C++ is called C++ because in C "++" was used to increase the value of variable by 1. So if C=1. C++ = 2. Which is to say, C++ is an incremented improved version of C.
@gurjindersingh3843
@gurjindersingh3843 4 года назад
@Artem Katerynych I forgot ++C was a thing
@GetBoros
@GetBoros 11 месяцев назад
Nice example of POD (Plain Old Data) type.
@benixmo
@benixmo 3 года назад
I've been using python and golang but honestly I am going to use C++ from now on. Literally every video you have with a "new" concept just leave me thinking "Wow that's really cool", C++ seems like the perfect language.
@adrmad8849
@adrmad8849 2 года назад
Great explanation m8!🔥
@prajjwalyadav3801
@prajjwalyadav3801 6 лет назад
it's nice to have a background music in the tutorials so that you don't feel sleepy ; P
@choppedsirloin9215
@choppedsirloin9215 3 года назад
This was an awesome explanation! I have done a little bit with UE4 blueprints so it made some things easier to understand, so hopefully the transition to C++ won't be too brutal outside of perhaps the syntax. I have a question though, would there be any reason for someone to want to use a function outside of a class as opposed to nesting it inside a class to make it a method? Because from how I'm seeing it, by making it a method, its much easier to use your code and it eliminates the need to have to create reference variables and pass those reference variables around.
@tetlleyplus
@tetlleyplus 4 года назад
Simply awesome!
@chetiprogrammer7051
@chetiprogrammer7051 6 лет назад
Can you show arrange me the right sequence of concepts (like Classes, Objects, Arrays, Pointers Constructors etc) to learn? Thankyou
@abx4t
@abx4t 5 месяцев назад
A side note. If you were to print x or y in the state of the code at 8:03, you would get a completely unknown value. This is because, as he talked about in previous videos, when the variable is created it get assigned a memory address. We have no idea what previous data was in that memory address, it could be anything. Thus, if you print it without initializing it, most often, it will be a seemingly random integer value left over from the last variable (even from another program) that used it. As a result, ALWAYS initialize your variables people. ALWAYS.
@darikostov9583
@darikostov9583 4 года назад
I am making a game in which i am trying to keep my code tided up by using classes for every character but when it comes to two characters to interact i have problems accessing the other class
@matteopiccioni196
@matteopiccioni196 Год назад
Very nice.. explicative, I just subscribed to your channel
@jemoedereetkaas8294
@jemoedereetkaas8294 2 года назад
Is there a reason why x, y and speed are separated even though they are all integer's, does it affect anything else or is it purely to make the code look cleaner/more tidy
@Bob-zg2zf
@Bob-zg2zf 5 лет назад
Fantastic vid.
@SolarPlayer
@SolarPlayer 4 года назад
I had a negative reaction to this vid in the first couple of seconds because I'm a superficial moron but I was a fanboy by the end. What a great explanation and high quality vid, impressive
@iamzepeqeno5086
@iamzepeqeno5086 2 года назад
me: oh so a class is to organize data ? cherno: no... *sight* not data, its DADA
@swapnilkarmakar3299
@swapnilkarmakar3299 2 года назад
5:10 Can someone explain why did he take Player& player in move function as a one of the parameters.
@rad5105
@rad5105 2 года назад
thanks so much
@KevinChoii
@KevinChoii 3 года назад
What I don't understand is that if we want to organize data and functions, can't we just use a .hile file for such things. What do classes offer that h files don't other than a private section?
@Boiea
@Boiea 5 лет назад
So, I get this video is on classes, but if I create a class, how would I get a return print that says, "Character has moved," when the umbra class variables have done their parts?
@zainabsiddiqui6154
@zainabsiddiqui6154 4 года назад
3:35 im a little bit confused I get that "player" is the name of the variable of type Player, but what value does this have?
@asiarahman6033
@asiarahman6033 4 года назад
0:56 Thank you! Now I ca. Pay attention to what you are saying. 😹😹😹
@henkee9554
@henkee9554 Год назад
Great video
@hamidrezarahimi6651
@hamidrezarahimi6651 3 года назад
Thank you
@luobei5083
@luobei5083 3 года назад
group the variable into a type and add functionality to those variables.
@IntegralDeLinha
@IntegralDeLinha 2 года назад
Very didactic! Thank you!
@sarangdagdu6524
@sarangdagdu6524 3 года назад
HI Cherno, how does the keyword "new" come into picture here? Is instantiating enough? does it allocate space in memory for the variable?
Далее
CLASSES vs STRUCTS in C++
8:32
Просмотров 461 тыс.
кукинг с Даниилом 🥸
01:00
Просмотров 491 тыс.
Python Classes in 1 Minute!
1:26
Просмотров 181 тыс.
How to Write a C++ Class
11:32
Просмотров 405 тыс.
10 weird algorithms
9:06
Просмотров 1,2 млн
POINTERS in C++
16:59
Просмотров 1 млн
Naming Things in Code
7:25
Просмотров 2 млн