VECTOR/DYNAMIC ARRAY - Making DATA STRUCTURES in C++

preview_player
Показать описание


This video was sponsored by Skillshare.
Рекомендации по теме
Комментарии
Автор

Bro please don't give up on finishing this series ...u r all I can rely on.🙏

sumeetsuryawanshi
Автор

Love this topic: Data Structures in C++ . Thank you soooo much .

thestarinthesky_
Автор

Recreating the vector class is a good exercise to explore and experiment various useful features of C++

Goejii
Автор

Learning data structures in c++ makes it much easier to understand and do in other languages. C++ was the language used in my comp sci program for intro to computer sci and for data structures and algorithms and now I’m doing data structures and algorithms in JavaScript preparing for interviews and that foundation in c++ helps a ton.

If anyone is a student and has to do c++ in school, don’t be overwhelmed. Trust the process, work hard, and you’ll do just find.

Cherno clutch yet again with perfect quality content!

tannerbarcelos
Автор

About 2 years ago I really became intrigued by stl. The vector class was the first one I tried recreating. And failed miserable. How ever I have redone this exercise about 20 times since. And I can write a vector class with the majority of the features one would want in about 1 day. I encourage everyone to do this exercise every once in a while. You always learn somethimg new.

cm
Автор

You still have a bug in ReAlloc function in line 95: newData[i] = std::move(...); - you can't use assignment operator here (either move or copy) because newData[i] is uninitialized memory - it is not the object of type T and by calling operator= (again move or not) you treat it as if it is object of type T. So instead of that you should use placement new once again so change that line to: new (&newData[i]) T(std::move(m_Data[i]));

Nikiux
Автор

Wow, that gotcha moment at the end was so inconspicuous that I'm a bit shaky in writing efficient C++ code and debugging it. May this series never end for the good of me!

krishp
Автор

I'm really enjoying these longer C++ videos, keep it up ! and thanks !!

joa_joa
Автор

Since We're big boys here... 8:25

It cheered up my dull day, thanx cherno

reedsdevine
Автор

Would love to see a video on variadic templates someday :)

supersquare
Автор

After all the fame, the fact that you keep this C++ series for dummies like me going, is amazing! The game engine series is way over my head and the reaction videos are not really my thing.. but I do hope that you are getting all the compen$ation you want because you deserve it... kuddos mate

crisdellani
Автор

The inplace new and operator new/delete part was new to me, and really amazing. I knew I'll learn something new from your video.

PrinceGupta-jolo
Автор

40:13 Constructors are being called there if you do a cout in your constructors you will see them print. But I assume the point being that they don't need to be called so thats why we switch to an operator new.

MrBlawkEyes
Автор

I don't know if you read all your comments but I just wanted to say I really am liking you breaking things down!

justwatchingstuff
Автор

For all those who did make it to 36:05, and then got lost after "HAHA did you think that was it?", Kudos to you.

youcefsb
Автор

42:06 line 98-99 calling the destructor on m_Size works if newCapacity >= m_Size. But if newCapacity < m_Size, you might miss out destructing some objects in m_Data?

koonhanong
Автор

Thank you so much Cherno, this video is absolutely phenomenal

supersquare
Автор

Very cool! I think I “know it all already” but usually learn something new in these! I’m writing my own containers now for my personal engine project and great to get some ideas from The Cherno 😀

foomoo
Автор

Please don't give up on this series. I started it yesterday and I am on video number 20. I love the way you teach.

butterChickenAndNaan
Автор

I have added more constructors which takes arguments as initializer_list :
1. Vector(const std::initializer_list<T>&);
2.

Then I have created a Student class and created three objects of it s1, s2, s3

And then I try to do following:
Vector<Student>students = { s1, s2, s3};
Vector<int>numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

So as I am passing s1, s2, s3 as "lvalues" for students and 1, 2, 3, ... as "rvalues" for numbers.
But in both of cases it is calling 2nd constructor. So why Vector<Student>students also calling 2nd constructor? Can you help me ?

darshitnasit