Seriously, you are better than my instructors at explaining everything. You are better at explaining than the damn books. These trimmed down and non bloated explanations are so much better than what I have been going through.
@BombeNissen7 жыл бұрын
Great set of videos! I study computer engineering, and work with C++ for nearly all assignments. When there's issues with the code, I've been using these videos to get a deeper understanding on how a certain topic works, and it's been a huge help. Keep it up!
@matthewortiz78596 жыл бұрын
I learned more watching this than a week taking my CSII course! Keep it up
@woofelator5 жыл бұрын
Same
@ytacctaccnt7 жыл бұрын
Go boy, go! You're my inspiration for learning C++. Your videos and your charisma and attitude!
@sizlax6 жыл бұрын
I double this. He's not like most of the other people that teach this stuff on youtube. Listening to most people is like listening to text to speech or Ben stein and watching pain dry at the same time. This guy will make my life if he avoids using the word GOOEY and says G U I like a normal human being.
@sizlax6 жыл бұрын
@@MrSerozka Sure, they make up something that sounds retarded and takes more to spell than the original spelling for... reasons! Fuckin millennials..
@mrbrian8263 жыл бұрын
I wonder after 4 years if you ever did learn c++.
@ytacctaccnt3 жыл бұрын
@@mrbrian826 Yes, but I still don't use it as my primary language, practically for anything... I'm into C# at the moment
@mrbrian8263 жыл бұрын
@@ytacctaccnt nice
Жыл бұрын
Fantastic channel! So great to get things explained by someone who actually knows what goes on behind the scenes, and who does not make absolutely everything into an programming analogy with food and animals. 10/10
@JoeyMcCart5 жыл бұрын
Man i'm so glad I found your channel, you're saving me rn
@bratanvonehre35595 жыл бұрын
Brilliant channel man! Right now I have to implement an algorithm in an efficient way in C++ for my studies, your videos are an incredible help!
@abdulcool12687 жыл бұрын
your videos are truly amazing. I wasn't able to catch up at first but now i really enjoy it and i am getting to understand more and more about c++ everyday
@flippygat34 жыл бұрын
Amazing channel, just found it. :) Also the first tutorial channel I have ever found that I do not listen to at 1.5X speed.
@ldmdesign56102 жыл бұрын
i need to slow it down sometimes i think lol
@nighma7 жыл бұрын
It will be so cool to compare one of the STL container (as an example) with one rewritten in the EA library and see the differences ;)
@arhantbararia3804 жыл бұрын
it will be 35$ extra for that DLC
@Blonder_Studio2 жыл бұрын
better not to, BF2042 is one reason for that, game so broken that Engine so broken as well and plus extra charge for DLC, so good that Cherno left EA
@lightknight8762 жыл бұрын
@@Blonder_Studio he's too good, passionate and professional for them.
@ashleycalhoun18246 жыл бұрын
Probably my favorite programming channel, Not only are his videos exciting, his style is so much cleaner. Best channel on youtube!
@jannesopanen80323 жыл бұрын
Yea he tends to dig a bit deeper than others :)
@ashleycalhoun18243 жыл бұрын
@@jannesopanen8032 here you are replying to a comment from a couple years ago, and I've already forgotten all I knew about programming.
@fayzankowshik36253 жыл бұрын
I love how you treat C++ like an actual language you'd speak in
@ryhi-gg15 ай бұрын
He explains it in such a clear way!
@yl24152 жыл бұрын
Up to this point it's not that I don't know all these, it's just I want to see how you program, because you have way better programming style than I did. Thanks Cherno!
@agentandy1593 жыл бұрын
11:30 Thanks for addressing this finally... Coming from C# I saw the method signatures in C++ and thought "are humans supposed to be able to read this"
@keidon68413 жыл бұрын
So much usefull information,u do not just give general understanding of a topic but provide the logic of its work i am glad i found your channel
@sanjayreddy32953 жыл бұрын
It's called a vector because Alex Stepanov, the designer of the Standard Template Library, was looking for a name to distinguish it from built-in arrays. He admits now that he made a mistake, because mathematics already uses the term 'vector' for a fixed-length sequence of numbers. C++11 compounds this mistake by introducing a class 'array' that behaves similarly to a mathematical vector. Alex's lesson: be very careful every time you name something.
@christianlabanca5377 Жыл бұрын
So now we have a class named Vector that behaves kinda like an array and a class named array that behaves kinda like a vector... Indeed, be careful when naming something
@clodgozon39684 жыл бұрын
11:34 Roughly speaking, abstract thinking develops over the years as a programmer which is a good trait so one doesn't have to stay longer into details like this.
@tanguyletessier3 жыл бұрын
Thank you! One of the best YT channels to explain simply difficult (at first glance) problems and especially put them into practice
@maryameskandari75105 жыл бұрын
I learned a lot , thanks pls keep it up and make some video about graph representation and boost library
@perelium-x3 жыл бұрын
Thank you SO SO SO MUCH BROOO! You don't know how you've just helped me... I understood every single thing you just said.😱👍👍👍
@ahmedanwar9766 жыл бұрын
at 9:48 if anyone doesn't understand how he initialized the struct you can search for "aggregate initialization".
@Xgamesvidoes5 жыл бұрын
Yepp... I was also confused with going from Unity C# vectors... To the C++ version of vectors! XD Nice video!
@manishgurawalia76254 жыл бұрын
11:40 C++ is love♥️
@MultiVishnu554 жыл бұрын
bro, you're too smart! goddamn, good shit
@abhisheksa6635 Жыл бұрын
Will be glad to see someone trying to rewrite a STL written thing which can be more optimal and more towards the personal use case.
@rcookie51287 жыл бұрын
Great stuff! The name confused me too when I first learned about std::vector..
@limmeh78814 жыл бұрын
To think I was modestly learning about pointers and jumped into this rabbit hole.
@serkanozturk42172 жыл бұрын
Personal Notes: -dynamic size, at the background it has limited memory but when reaches the limit, it creates a bigger sized memory and copies contents to it. - #include - std::vector vertices To add: entities.push_back((1,0,0)) (must be implicit conversion) - can use it in for loop: for(Vertex v: vertices) { //do sth } To prevent copying and being faster, for(Vertex& v: vertices) { //do sth } - to delete 2nd element: vertices.erase(vertices.begin()+1)
@work91673 жыл бұрын
This is amazing, man. I like your videos so much
@Solo6R6 жыл бұрын
You're a god with a compiler. Been programming in C++ for longer than I care to admit, and when I stumble across something I'm not 100% confident with I think "I wonder if Cherno can help me out here" and sure enough you can, and have, several times! Keep up the good work bud, VERY much appreciated.
@MichaelYoussry7 жыл бұрын
Thanks for putting so much effort into these videos.
@archimedeis2 жыл бұрын
Wow that was pretty well done. I think I got enough to try out my own sort of mini project.
@tannerbarcelos68805 жыл бұрын
Yet to understand why my professor decided to teach so much array stuff but said “vectors are the same so I’m gonna skip over them” when in reality, these vectors are beautiful works of art that shit on arrays lol. Simply the fact that they’re dynamic makes life so easy.
@vaddimurthyram33644 жыл бұрын
Thanks a lot......clearly explained basics about vector(Dynamic Array or Array List)👏👏👏
@genelee20506 жыл бұрын
it happened again. Near the end of the video, I thought someone else was playing music somewhere until i realized the source coming from this video...
@diassagatov97843 жыл бұрын
Enough eye contact for today
@orbyfied4 жыл бұрын
so i didnt know how the vector class worked, so i created an "ArrayList" class, and i did the exact same thing that the vector class does xD to add an element just create a new array with current size + 1 and copy all of the previous contents into array[0 to size-1] and put the new element into array[size]
@orbyfied4 жыл бұрын
@Peterolen i know but it is sort of a simplified version of the vector and ArrayList. It has the same concept behind it
@shadyganem54485 жыл бұрын
Great video. I learn so much from this guy. real talent. I would like to learn more about the best practices of memory allocation.
@CombatFXZone5 жыл бұрын
I absolutely love the comparison with Java, because I started out with Java in High School.
@Blonder_Studio2 жыл бұрын
learning programmin in high school sucks balls i learned c# in high school and my "teacher" is a piece of shit bad
@nhensonbass2 жыл бұрын
I know this is about five years later, but another reason I've learned not to store pointers in vectors is that the element can be deleted from the vector leaving a memory leak. If you're using vectors with pointers, be careful.
@zaid47085 жыл бұрын
"Simple spice series" very accurate caption
@erwinschrodinger23203 жыл бұрын
Great video as always!
@jms5474 жыл бұрын
At 8:50 there's a note about moving rather than copying. Is there a video about this in this series?
@hassantariq47314 жыл бұрын
Thank You For Saving My Semester :)
@younismalik8809 Жыл бұрын
Thanks The Cherno! Great explanation as always! 👍
@TheTrashpack2347 жыл бұрын
Is it bad that instead of watching the video I'm just watching his hands?
@1Naif7 жыл бұрын
No
@PflanzenChirurg7 жыл бұрын
explains pretty much everything
@mprecup7 жыл бұрын
If I'm watching his hands, it's because he's getting close to backhanding the cactus.
@MsJavaWolf6 жыл бұрын
That is the purpose of the video. The hand gestures are an advanced form of hypnosis that will make you understand vectors better.
@Dunestorm3334 жыл бұрын
I think The Cherno is secretly Italian ;)
@PongPongDudlDu8 ай бұрын
Hey Cherno! I got a little question about passing the vector to a subfunction: In the Video at about 12:50 you are passing the vector via Function(vertices); I would have expected a Function(vertices&); to specify it as a pointer or a reference, basically. In C, every array is automatically passed by reference, it will never be copied. Is it in C++ depending on the parameters of the target function as it is a pointer in your example? Would love to hear your answer as I am a C developer and sometimes C++ is still a little strange to me. All the best!
@GenericPhantom12 жыл бұрын
Dynamic arrays (mostly std::vector) is an array which can resize. You can push new things into it.
@hangyanma25012 жыл бұрын
你好,陈诺,你的课讲的太好了
@李景天4 жыл бұрын
I remember in Bjarne Stroustrup's book, he never talks about raw array, he just went a head and talks about std::vector.
@sharrayyy3 жыл бұрын
Coding and guitar That's an awesome combo!
@lizzienovigot2 жыл бұрын
In linear algebra pne of the basic example of vectors is exactly what programmer would think of as an array or a tuple. So mathematically its quite natural to identify arrays and vectors as being very similar, if not the same thing
@cowboybebop5214 жыл бұрын
very nice little class learned so much cheers!
@stevefox74184 жыл бұрын
Very nicely explained and very informative!
@paul871734 жыл бұрын
hey cherno, why dont you use "using namespace std" when you code?
@carlomiriani5588 Жыл бұрын
can someone explain me this function? i understand that it takes the vector as parameter, but why "std::ostream& "? It returns stream?? why is it that? i know is operator overloading stuff, but he's not really beginner friendly with this kind of stuff.... std::ostream& operator
@alexdavidsantiago39554 жыл бұрын
All the videos have in common that when you made a question and the answer is: "It depends"
@blackfun44484 жыл бұрын
you are amazing at teaching, keep it up!
7 жыл бұрын
please make parallel process and simd tutorial
@dmitrijjafisov19127 жыл бұрын
Quality content! Thumbs up!
@abhayagarwal71036 жыл бұрын
Man, your concepts are so clear.
@kemptcode7 жыл бұрын
You should mention emplace_back in another video.
@joriskbos11156 жыл бұрын
I was writing a little game in c as a bit of a challenge and I had to write my own dynamic array. The way I did it was that you create it with an initial size, but when it exceeds the size, the size of the array doubles. That way I don't have to reallocate the array every single time I add or remove an element, but I'm also not using up too much memory.
@sethtaylor75196 жыл бұрын
I'm pretty sure that is what vectors do as well.
@amaanmohammed61312 жыл бұрын
what happens if there are no vertex does not have parameters would it just be vertices.empalce_back() ?
@manuellabor27596 жыл бұрын
Subscribed! Looking forward to going over your videos on C++👍👍👍👍👍
@chemistrymickey5 жыл бұрын
Hm... While following along after making the Vertex class and attempting to print it to the console using std::cout
@Byynx11 ай бұрын
Should we call STL to the C++ standard library ?
@sidharthcs21104 жыл бұрын
In physics we can represent a vector as a row or column matrix( kinda like a 1d array ). maybe that's why
@Moren1627 жыл бұрын
Please go in to data structures! All other videos is not even close your your quality!
@georgecristianiordan37126 жыл бұрын
Well i would like to see a video with data structures too, youtube lack of quality videos with data structures in c++.....
@ags00046 жыл бұрын
Data structures are supposed to be abstract and language agnostic, unless they need to meet a very specific need. But assuming you are talking about datastructures such as Queues, HashMaps and all that, the implementation is relatively the same. The only thing that might be a little different may be some fine tuning using your knowledge of the language to optimize some bits. But they should work the same way they would in every other language. Knowing how one is implemented in abstract and knowing the language you are going to implement them on is the only thing you need.
@dan1100249 ай бұрын
As a front-end JS dev, 3 days ago I had not a care in the world for performance. Half way through this C++ playlist and my first thought on hearing how this works is 'Damn that must be expensive.' JS seems so basic now lol.
@lowieh.3451 Жыл бұрын
I tried casting an int to (std::vector::const_iterator) to use as argument for the erase function, to no avail. Anyone understand what happens when vertices.begin + 1 is used as an argument? It seems there is some conversion going on, right? Why can the '1' be used there without any problem?
@ncky24314 жыл бұрын
Am I the only one that thinks the push_back({ 1, 2, 3}) looks weird. He said that this is done with the member initializer list however to me looks more like implicit conversion. Can anyone explain?
@stewartzayat75267 жыл бұрын
I have a question not related to the topic, why are classes in the standard library defined with lowercase identifiers, even though everyone declares classes with camel casing?
@jayasribhattacharya20484 жыл бұрын
In java compiler is your teacher but in c++ the compiler is your friend.
@JohnnyRelentless7 жыл бұрын
I thought that arrays were pointers, so that you are never really passing the array to the function, but only the pointer, so you wouldn't need to pass by reference. Is it different for dynamic arrays, or am I misunderstanding something?
@sewingsugar98924 жыл бұрын
Can you recommend a book or course that gets more in depth information about behind the scenes of c++?
@Hoptronics Жыл бұрын
Ugh.. I've been passing just pointers around. Like: void setName(const char* txt){ _name = memcpy(txt,strlen(txt)+1); } Is this bad??
@alexwhite61337 жыл бұрын
Why the std team dont rename it to List ????????? simply as that?
7 жыл бұрын
This will result in failing builds for all the codebases which are using std::vector. It's not that easy to change the api which is standardized.
@meJevin7 жыл бұрын
too many pages of documents would have to be rewritten, too much work in general would have to be done in order to make some class name more 'intuitive'. list is not a good name, btw. that's another data structure that operates differently, and already exists in c++. he'll probably talk about them.
@Hopsonn7 жыл бұрын
Alex White not to mention list is already part of the std (linked list)
@krood_6 жыл бұрын
Whats the difference between dynamic array and vector ? are they both the same thing ?
@drxddy3 жыл бұрын
If i have a pointer to a vector which then moves to a different memory address to due to resize does my pointer automatically point to the new memory address?
@ycp1013 жыл бұрын
Yes, you are great! your ccoding skill are great! I envy you!
@Anonymous-mz9un4 жыл бұрын
i am a beginner. But why you are not using namespace std; along with headers? Thanks in advance.
@miguelbarroso_4 жыл бұрын
It's a bad practice.
@Anonymous-mz9un4 жыл бұрын
@@miguelbarroso_ Will you elaborate please?Sorry if it sounds naive. I believe that makes your whole code type faster. Thanks in advance.
@Anonymous-mz9un4 жыл бұрын
@@miguelbarroso_ Ok ignore my comment. importing whole name space is memory wastage got it. But what about using it like this typedef std:cout cout; typedef std:cin cin;
@miguelbarroso_4 жыл бұрын
@@Anonymous-mz9un The Cherno made a video about it. Just search for: "Why I don't use using namespace - The Cherno"
@Anonymous-mz9un4 жыл бұрын
@@miguelbarroso_ Thank you :)
@kensparkgg4 жыл бұрын
*making video as soon as you wake up*
@otangerineo Жыл бұрын
i love you papi cherno
@jonathanolivier69322 жыл бұрын
Good video, but if you have a vector of string, what can you do if you want the first character of a string?
@sirrcharles18694 жыл бұрын
The code on the screen does not compile. Use: | std::cout
@tahaalkhashmany56784 жыл бұрын
does it basically work like dynamic memory allocation with malloc/realloc in c?
@Stav_Bodik3 жыл бұрын
A vector is a list of something (numbers for example) (can be in a row or column), A matrix is an array of vectors (one or more rows, one or more columns). More specifiec in Math, A vector is an object that has both a magnitude and a direction represented by numbers...and if you think about it, it is a line in some direction in some dimension that has a list of numbers and has start/end (size/magnitude). So you are little bit wrong, vector is a very good name (: Maybe hard to understand like ArrayList but Yes it makes sense.
@ibrozdemir6 жыл бұрын
12:32 why do i have to indicate reference when i am passing actual classes in methods? void Function(const std::vector& vertices) isnt vector a class? its not a struct or a simple type, it shouldnt be get coppied just because i put them as parameter
@ibrozdemir6 жыл бұрын
@Peterolen so if dont put & this there, compiler will only copy the pointer address right? not the actual class.. so i only prevent copying content of the method parameter variable right?
@ibrozdemir6 жыл бұрын
@Peterolen this is realy feels different then other languages i coded.. copying whole object.. objects treated differently then int or float or struct in other languages.. it will be hard to get used to this.. thanks for the help man
@GoofyTHPS4 жыл бұрын
When you erase Vertex from your vector, shouldn't you also delete the Vertex instance?
@lukasmodry1963 жыл бұрын
Is there any reason why you not use ""using namespace std;" ?? Or you are just use to type std infront of code?
@jimhalpert98033 жыл бұрын
He has a video on this topic
@saikirangattu29247 жыл бұрын
Very nice , Please make more videos on other data structures
@rafikmoh92953 жыл бұрын
hello, I have a code which is working for the existing hardware setup but now I want to extend this code for mutiple hardware at a time. for this type of project. can anyone guide me on this this.
@michaelwright85764 жыл бұрын
Why aren't the array elements printed in a single line?
@shahzaman20893 жыл бұрын
kindly can someone tell me where is the AISTL link
@lKyoto5 жыл бұрын
Video on advanced vector class: not found. :C
@marcol62684 жыл бұрын
I probably understood everyhing in that video (or not) but I still keep failing at solving a rather "simple" problem, that I could not figure out how to do, even with this great explanation. Here is my problem: I wanna write a short programm that allows the user to define how many numbers he can type in ("store" w/e). So something like std::cin (n). So if he types 5, then with some couts he gets told to write the 1st number, 2nd, and so on. So e.g. 1,2,3,4,5 and after he did that they just get displayed. That is all to it. How do you do this? I have a solution but this solution only works with compilers that allow "int array [numbers]" ( so a "not constant" within an array). This probably will never be read anyway but if yes, help is greatly appreciated.
@fwfwe48y4t4 жыл бұрын
How can I make a vector of strings?
@samdavepollard4 жыл бұрын
i'm a noob but FWIW: #include #include #include int main() { std::vectormyStrings; myStrings.push_back(std::string("This would")); myStrings.push_back(std::string("be one way")); myStrings.push_back(std::string("of doing it")); for(std::string& s: myStrings){ std::cout
@theamjolnir96416 жыл бұрын
how do you access vectors of vectors? like in an matrix cause you can't exactly do matrix.assign() to a specific value can you?
@huthayfa17236 жыл бұрын
Nice video ; I'm really confused of these vectors in computer science if we needed a dynamic array we would use a linked list . what is the difference between these two ?