STL vector (Relationship between Static array, Dynamic array and STL vector) with examples

Ғылым және технология

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. You can use the link below to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
In this course, you'll learn about the relationship between STL Vector, Static array and Dynamic array.
You'll learn the most important characteristics of each, their advantages and disadvantages, and examples of when to use them.
I'll also show you how to work with STL Vector, access, insert and delete elements from a specific position inside STL vector, what are iterators and constant iterators, examples, use-cases, and all other important STL Vector functionalities.
👉 Download Visual Assist here: bit.ly/VisualAssistDownload
(Improves Visual Studio experience by quickly identifying and fixing code errors)
Contents:
00:00 - What you'll learn in this video
00:46 - Best VS plug-in for C/C++ dev
02:14 - Static arrays (characteristics, advantages, limitations, examples)
06:43 - Dynamic arrays (characteristics, advantages, limitations, examples)
08:29 - What is STL vector
09:50 - Working with STL vector (important functionalities)
25:37 - STL vector vs Dynamic Array vs Static Array
Other videos to watch:
My favorite Visual Assist features: • My top 5 Visual Assist...
Static arrays: • DATA STRUCTURES - How ...
Dynamic arrays: • C++ POINTERS (2020) - ...
Follow me on other platforms:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty

Пікірлер: 189

  • @CodeBeauty
    @CodeBeauty Жыл бұрын

    📚 Learn how to solve problems and build projects with these Free E-Books ⬇ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. Code from the video: #include #include using namespace std; void main() { vectornumbers; //numbers.push_back(0); for (int i = 1; i

  • @ProjectVastness

    @ProjectVastness

    Жыл бұрын

    Thanks for one more video, this remember me good all times when I was learning C more than 25 years ago.

  • @hilgicamala2520

    @hilgicamala2520

    Жыл бұрын

    saldina thank you so much for this video, your videos are the best

  • @programmerdev7251

    @programmerdev7251

    Жыл бұрын

    good work

  • @JPEaglesandKatz

    @JPEaglesandKatz

    Жыл бұрын

    Hope you are doing okay!! Haven't seen you around for a while... Your videos are top notch!! Take care!

  • @normanhenderson7300

    @normanhenderson7300

    10 ай бұрын

    So Code Beauty, after explaining the disadvantages of dynamic and static arrays, under what conditions they are useful in programming?

  • @heikin5562
    @heikin55623 ай бұрын

    Your way of explaining is so practical and easy to understand. I've learned a lot by watching your lessons everyday. Thank you!

  • @andrecorrea6957
    @andrecorrea6957 Жыл бұрын

    I'm starting over from 0 and remembering everything I learned at the computer science university I did here in Brazil. I was away for a long time and I encouraged myself to move on, you are really amazing, you are helping me a lot.

  • @dundyd3612
    @dundyd3612 Жыл бұрын

    very helpful, i finaly understand when to use arrays (Static) and when to use vectors. thanks saldina

  • @gollygobih6527
    @gollygobih6527 Жыл бұрын

    I watched all your videos about arrays, dynamic arrays and multidimensional dynamic arrays, so I knew this one is going to be great as well. Thanks Saldina

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    I'm happy that my videos helped you 😊💜

  • @SDot228
    @SDot228 Жыл бұрын

    Your C++ videos have been a lifesaver. Thanks for making it easy to learn. Any plans to do a video on runtime analysis/optimization?

  • @Pepespizzeria1
    @Pepespizzeria1 Жыл бұрын

    Very new to coding, just finished your ten hour coding video on c++, found the diagrams extremely useful and the explanation, this video was useful to, thank you

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    Happy to hear that. Diagrams are a great way to learn programming, they help you to visualize code even when you don't understand the commands. 😊

  • @ramakrishna4092

    @ramakrishna4092

    Жыл бұрын

    ​​@@CodeBeauty hi mam I have learnt programming languages by watching your videos in channel . yesterday I have given an interview almost I felt got a job but the final question was too unexpected by interviewer. she asked me return two 2d array from function without heap . I said we can create a static array and return to the main .she also asked me to implement the code but I didn't get the correct answer . later interviewer told the prototype of returning 2d array is not correctly written . pls mam I am requesting can you do a video on this topic... love from India..

  • @l.p.1967
    @l.p.1967 Жыл бұрын

    amazing explanation, cleared all my doubts as always

  • @nv9usb381
    @nv9usb381 Жыл бұрын

    I was waiting for this video, love it!

  • @paulkap12
    @paulkap125 ай бұрын

    Among many other youtubers that I tried to get help in my C++ learning, you are really the best one! Thank you!

  • @cristianomoreira3305
    @cristianomoreira3305 Жыл бұрын

    Oh.. Saldina, you have the best channel of programming in this world. The BEST, now I'm a python/JS programmer but I watch your videos just because your explaining is perfect! Thanks for this!

  • @JarekAtWork
    @JarekAtWork Жыл бұрын

    I want to say thank you. I watched all the episodes, it was an amazing adventure. I started with the basics, then functions, pointers and then data structures. I think I am ready for object-oriented programming lessons. I must admit that this will be new to me, but with your help, I am sure I will be able to understand this concept.

  • @alishafii9141
    @alishafii9141 Жыл бұрын

    hi dear saldina , i am 48 years old and I am beginner , you give me as gift more than gold and diamond, you give me "TIME" and "UNDERSTAND", your tubes reduces time of learning and save it and gains performance of understanding. please continue

  • @yeromin_g
    @yeromin_g Жыл бұрын

    Such a lovely and smart young lady! Pure pleasure to watch your videos and learn with your help. Keep going!

  • @clandeszipp4564
    @clandeszipp4564 Жыл бұрын

    I applied to CS BSc studies today. Wish me luck! 🤞

  • @elonfc

    @elonfc

    Жыл бұрын

    Same here bro ,did ur colleges start?

  • @nocopyrightgameplaystockvi231

    @nocopyrightgameplaystockvi231

    Жыл бұрын

    Best of luck bro.

  • @mirahamdan7369
    @mirahamdan7369 Жыл бұрын

    this is perfect timing i was just hoping to find a vector video by your great channel

  • @lickguitars1276
    @lickguitars12768 ай бұрын

    thank you for this content, you made it clear to learn and giving out the pros and cons, a lot of thanks❤❤

  • @spanningtree5869
    @spanningtree5869 Жыл бұрын

    Thank you so much for starting stl series ❤ 🥰

  • @chadidridi9306
    @chadidridi9306 Жыл бұрын

    your methods are so easy to understand unlike many youtube contents ! Please would you make some videos about Datastructures and some advances search algorithms using C++.I'm sure you can explain it perfectly!

  • @akosyt4540
    @akosyt4540 Жыл бұрын

    Thank you so much Saldina for this amazing tutorial 🥰.I hope you make a video about queue vs stack and their advantages and desadvantegs and which one to use according to the situation.

  • @sumanthnaidu9598
    @sumanthnaidu9598 Жыл бұрын

    *Please Make more videos from STL. And cover all the containers in STL with it's built-in functions.* *Remaining one's are :- Deque, List in ( sequence Containers ) & Set, Mult-Set, Map, Multi-Map ( Associative Containers ) & Stack, Queue ( Container Adapters ).*

  • @pkerr1753
    @pkerr1753 Жыл бұрын

    I love this channel. I learn so much.

  • @marcolanza6281
    @marcolanza6281 Жыл бұрын

    Hi CodeBeauty, Most of the time, I watch KZread videos on my TV and there's no way to make comments. I am a Software Engineer for quite some time/years and worked on and off with diff. prog. languages and etc. I have been watching some of yours and you explain the topics very well in a concise and clear manner along with the examples. I am in love with ❤

  • @johnalvinm
    @johnalvinm Жыл бұрын

    Your videos get better every time❤

  • @k.s.5815
    @k.s.5815Ай бұрын

    not only the appearance, your way of teaching is beautiful. Thanks a lot!

  • @soumilmaitra9466
    @soumilmaitra9466 Жыл бұрын

    I am a specialist at Codeforces yet I like to study about STL vector a lot (especially this one).

  • @maheshvelugula8418
    @maheshvelugula8418 Жыл бұрын

    your videos very useful to me , thank you ,keep going

  • @indarklove6850
    @indarklove6850 Жыл бұрын

    thank you! Nice work!

  • @adibahbab6859
    @adibahbab6859 Жыл бұрын

    Nicely explained! ❤️❤️ It'll be better if explain 2D vector as well in this video.

  • @christopherrice891
    @christopherrice891 Жыл бұрын

    I'm subscribed to your KZread channel and i have the bell notifications turned on as well. I am very curious if you can give any hints about how soon your next KZread video will be out and also can you give any hints about what your next C++ topic is going to be about? You are an awesome teacher, you clearly explain C++ concepts so well i can re-watch your past videos over and over again.

  • @HuyenNguyen-wm7dj
    @HuyenNguyen-wm7dj Жыл бұрын

    Your video is really helpful for me. Hope you release more videos about STL vector🥰

  • @issahtalent7511
    @issahtalent7511 Жыл бұрын

    I wish u were into Java too, I love the way u explain concepts into simple and understanding way. Thanks for the videos though, learnt new stuffs😁.

  • @bubblesort8760
    @bubblesort8760 Жыл бұрын

    Thank you very much for your beautiful videos. I wish you made a video about graph data structures.

  • @matteoferraretto1012
    @matteoferraretto1012 Жыл бұрын

    Very useful, thanks!

  • @s0hni19
    @s0hni19 Жыл бұрын

    very nice! im interested in the usage of c++ 20 modules. would be nice if we see that soon

  • @kailas813
    @kailas813 Жыл бұрын

    Will you please plan for adding sessions about design pattern concepts? Thanks a lot for your effort and time.

  • @AlaaDablan
    @AlaaDablan Жыл бұрын

    Saldina, ur tutorials are bloody amazing; thanks a lot. However, I really would appreciate it if u dedicate some videos to embedded systems (using Eclipse IDE, STM32 IDE, TI...; if recommended). Introductory projects; nothing more. Thanks again for all ur efforts.

  • @ducloc2003
    @ducloc2003 Жыл бұрын

    How to focus on learning to code when there is a beautiful teacher like this🧐

  • @md.naimemolla8543
    @md.naimemolla8543 Жыл бұрын

    Hey Saldina, I coming from freecodeCamp. Ur OOP course was great and ur explanation was beautiful like u.

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    welcome and thanks 🥰🥰

  • @c3rk3m4f1a
    @c3rk3m4f1a Жыл бұрын

    Odlični videi , počeo sam da učim C ++ pre mesec dana pa nisam skroz savladao pointere nadam se da to nije problem i da ću vrememom naučiti . Veliki pozdrav ❤️

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    Super, javi kako ide 😀

  • @joseloeza371
    @joseloeza37111 ай бұрын

    so beauty and smart.... what I need... Thanks excellent video

  • @user-oj4uk8wi7n
    @user-oj4uk8wi7n7 ай бұрын

    dear, precise and very clear explanation, easy to understand. the way you explaining etc are excellent, the name codebeauty, is like beautiful like you, and its very rare that both your talent of teaching skills and yourself very lovely and beatiful. Please keep posted.

  • @LucaCanali
    @LucaCanali Жыл бұрын

    you are a amazing girl ... each video gives us more knowledge and tips

  • @edgarpapikyan3202
    @edgarpapikyan3202 Жыл бұрын

    I have changed to Dart language. But still watching your videos sometimes. Thank you. 😉

  • @kenzo3477
    @kenzo3477 Жыл бұрын

    Hi Saldina. Am glad to let you know that you saved my life through easy to comprehend lectures. Thanks so much Madam. Truly, I tell you that your tutorials can make Ben Carson abandon Medicine and be a Software Engineer. Lol. Anyway, just wanted to know,,,, is it in your will to do tutorials on other languages like Javascript or even some web dev frameworks?? If so, am patiently waiting for the publishing of the first video. You amazingly awesome with how you teach us. Thanks so much. 🙏

  • @OthmanOthman-c7s
    @OthmanOthman-c7s4 күн бұрын

    Hongera wewe ni mwamba👏❤

  • @Man-gm3tx
    @Man-gm3tx Жыл бұрын

    Thank you very much

  • @nataliagrace5717
    @nataliagrace5717 Жыл бұрын

    Hi I'm new to this channel I recently started watching your 10+ C++ Course and I love it so much!! The way your explain everything is perfect for me and it helps me understand a lot. I was wondering what is your accent? It's so pretty but I can't figure it out lol. :)

  • @kailas813
    @kailas813 Жыл бұрын

    Thank you. Very helpful. I am also watching all your c++ related, I wanted to share one concern as the viewer, Could you please include interview questions on the topics at the end of each session? It would be much more helpful for someone like me who preparing for an interview. Just a request concern :-)

  • @fidalgoverde
    @fidalgoverde Жыл бұрын

    Excellent.

  • @aufauf1957
    @aufauf1957 Жыл бұрын

    Thank you

  • @mosslnnx
    @mosslnnx Жыл бұрын

    Thank you 👍

  • @warunagunarathna7214
    @warunagunarathna72149 ай бұрын

    thank you 🥰

  • @hangugsalam6383
    @hangugsalam6383 Жыл бұрын

    thanks for all videos i am waiting for you to make an video for consts and especially consts in functions!!!!!!!!!!!!!!! it is hard to understand i think

  • @sunbreeze7354
    @sunbreeze7354 Жыл бұрын

    Love you much!

  • @Right_place
    @Right_place Жыл бұрын

    Hi saldina nurak Madam.. can you make videos on DBMS ( database management system)

  • @matthewparisien3504
    @matthewparisien3504 Жыл бұрын

    Thank you as always!!!!

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    You're welcome 🤗🥰

  • @mixedreality8564
    @mixedreality8564 Жыл бұрын

    Thanks Saldinah

  • @epic_amvs4095
    @epic_amvs4095 Жыл бұрын

    Coming from freecodecamp oops lecture your videos are awesome 🙌+ you are looking cute in that outfit ❤

  • @JarekAtWork
    @JarekAtWork Жыл бұрын

    If the size of an array is unknown or changes during program execution, vector may be more appropriate. Vector is easier to use because it provides automatic memory management, and its methods allow for easy addition and removal of elements. In addition, vector provides many useful functions, such as sorting and searching elements, which greatly facilitate programming in C++. In summary, the decision of whether to use a dynamic array or a vector depends on the specific case and program requirements.

  • @mihailvrabie7644
    @mihailvrabie7644 Жыл бұрын

    Thanks a lot for good information related to vectors. I have a problem to solve in c++: (Input: 1+ 5 + 3 + 4, Output: 1 + 3 + 4 + 5). The question is : can we solve that with vectors and how? Thanks in advance!

  • @asimuddin3222
    @asimuddin3222 Жыл бұрын

    Thank you . Can you teach us about algorithms please. I hope it will be superb for your content and it will help us too.

  • @clustersnake
    @clustersnake Жыл бұрын

    Dear lord! C++ was my favorite programming language in college and now I see that exists an auto data type! I need to learn some new things!

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    Welcome to my channel, hope you'll enjoy the C++ content :D

  • @clustersnake

    @clustersnake

    Жыл бұрын

    @@CodeBeauty Oh! I love your content. I'm Venezuelan and thanks to you I am learning English too 😄

  • @hollywoodmovies497
    @hollywoodmovies497 Жыл бұрын

    can you do a video on the complete STL course on all topics briefly??

  • @sandra1250
    @sandra12509 ай бұрын

    Thanks

  • @rgijsbertse
    @rgijsbertse Жыл бұрын

    Hi Saldina, I enjoyed your video on STL Vector. However this is the simple version of Vector values. What about a sorting Vector containing Class pointers or structs. This will need a custom sort function to sort on members of the objects. This may be a idea for an extension of this video, or maybe an 'advanced STL Vector' tutorial? I hope you can do something with this idea. Love your videos. Bye, Ron

  • @shayanchabook7656
    @shayanchabook7656 Жыл бұрын

    Hi, hope u r fine. I was wondering if there is any way that you can transfer the content of a struct vector into a struct through STL algorithm in C++?

  • @CPP_malloc
    @CPP_malloc Жыл бұрын

    vectors of course are better, emplace_back is one of its power, to avoid calling a constructor to create a temporary object and then move it. I realize that emplace_back can be implemented in dynamic arrays easily, but productivity is very important. as well I see no performance improvements in using dynamic arrays over vectors, as compilers already inline all vectors class member functions. as well vectors are nothing more than a wrap-around a dynamic array and obtaining a raw pointer of any element is possible. they are contiguous data in memory, which means math operators are applicable to the returned pointer. you have demonstrated all of that in the video. I also prefer using std::array over the old style of [ ], it also has no performance overhead, because it is POD struct, with only the same size of the total elements in the array.

  • @udaykumaruday4159
    @udaykumaruday4159 Жыл бұрын

    Hey saldina i am free code camp. U r amazing 😚

  • @Anonymous-wx8kk
    @Anonymous-wx8kk Жыл бұрын

    Sista pls can u complete full course of DSA. 🙏Plss huge request from 🇮🇳India. Ur way of teaching is of another level. 🔥❤❤❤❤🥰

  • @boonedockjourneyman7979
    @boonedockjourneyman7979 Жыл бұрын

    You are beautiful. That doesn’t matter. You are great at what you do. I searched for lessons like this. You were the best. Forget your beauty. It will fade.

  • @pvtdd
    @pvtdd11 ай бұрын

    How come you don't have to do std::vector::size_type and then assign that to a variable to get the size of the vector ?

  • @rebei
    @rebei Жыл бұрын

    The value of the fifth element in the vector!

  • @zapped5272
    @zapped5272 Жыл бұрын

    Is it better to use Visual Studio or VScode?

  • @olebeh
    @olebeh Жыл бұрын

    Hello. Wanted to ask, how do you put semicolon at the end of the line automatically? Formatter doesn't do it

  • @KeyT3ch
    @KeyT3ch Жыл бұрын

    Treat Gits!

  • @atlantic_love

    @atlantic_love

    Жыл бұрын

    I bet you have Taddy Dits.

  • @yogesh124
    @yogesh124 Жыл бұрын

    Can you please arrange your videos one by one with right order in an playlist

  • @Thebiggame-dc8ek
    @Thebiggame-dc8ek Жыл бұрын

    Thanks for the useful subject. I wonder why we can't use it(the iterator) by itself for gaining the address of an element of the vector if it is a pointer. And also why it wasn't defined as a pointer, like: int *it instead of being auto without asterisk. I appreciate if someone gives their comment on it. thanks.

  • @technicaltechnmofficial2513
    @technicaltechnmofficial2513 Жыл бұрын

    Hello Ma'am You make videos on cpp which are great actually ... PLEASE CAN YOU MAKE A VIDEO ON HOW TO CREATE DB APPLICATION USING VISUAL STUDIO FROM A CONSOLE APPLICATION ...

  • @arshmaanali714
    @arshmaanali714 Жыл бұрын

    mam plz make video on functions and how call stack works..

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    it's an i interesting suggestion, thanks 😊

  • @arshmaanali714

    @arshmaanali714

    Жыл бұрын

    @@CodeBeautyMam Thank you so much😍 for providing great knowledge .You are very kind and humble.

  • @toto_frs620
    @toto_frs620 Жыл бұрын

    could you make a video on how to make an API rest with c ++? I am looking for an alternative to Spring

  • @sanjayramsinghani5725
    @sanjayramsinghani5725 Жыл бұрын

    I completely love your way of explaining 😍 but now i am struggling with learning git and git hub can you please make tutorial for how to use git and git hub please

  • @RiddleSI

    @RiddleSI

    Жыл бұрын

    github

  • @user-xr4zb4tz4i
    @user-xr4zb4tz4i Жыл бұрын

    Ma'am please make a video on Python. Love from India.

  • @gleenji10086
    @gleenji10086 Жыл бұрын

    I love studying!!!!!!

  • @CodeBeauty

    @CodeBeauty

    Жыл бұрын

    Maybe you could share a few tips regarding this, beacuse many people study only because they have to 😄😄

  • @katiagalkina4607
    @katiagalkina4607 Жыл бұрын

    Saldina tysm !👍 17:06 iterator position 1? 🤔

  • @MuravaDnevnik
    @MuravaDnevnik Жыл бұрын

    Wow

  • @Dingdongbubbble
    @Dingdongbubbble4 ай бұрын

    omg i love vectors

  • @boonedockjourneyman7979
    @boonedockjourneyman7979 Жыл бұрын

    Do a full length, serious video on coding interfaces (such as IDEs). What programming “shells” are out there? Advantages and •••. I say shells in quotes because that is the language we used in 1981. Not too sure what the correct words are today. Maybe look at stone age things like VI. That may give you a sense of where things started. I’m sure there are more old guys watching that can recommend things from the pre-fortran world. Fortran and Pascal led to C. Maybe BSD is a better starting point - no offense to the Pre-Fortran guys. In all seriousness, you could do a few minutes on “shells” and teach your generation where they come from.

  • @chesshooligan1282
    @chesshooligan1282 Жыл бұрын

    What kind of performance gains do you get by using a dynamic array instead of a vector? Why does everybody seem to think de-allocating your memory is such a big deal and prone to bugs? Remembering to put a 'delete' statement after you're done with your array doesn't seem that hard.

  • @technicaltechnmofficial2513
    @technicaltechnmofficial2513 Жыл бұрын

    Hi ma'am please make a video on "KEYBOARD AUTOMATION" using C++ . Through which i should give an input to another application using C++ program .

  • @irfanmalick5073
    @irfanmalick5073 Жыл бұрын

    YOU ARE SO PREETY AND BEAUTIFUL AND URS STYLE OF TEACHING IS GORGEOUS

  • @nageshnani9609
    @nageshnani9609 Жыл бұрын

    Hello codeBeauty, how line space will be taken automatically, it's amezing but how?

  • @utkarshtekwani1039
    @utkarshtekwani1039 Жыл бұрын

    please upload dsa of C

  • @Prince-gf5bj
    @Prince-gf5bj Жыл бұрын

    what microphone do you use?

  • @irfanmalick5073
    @irfanmalick5073 Жыл бұрын

    u also make video on python

  • @mirazizmirtojiyev7278
    @mirazizmirtojiyev727811 ай бұрын

    Thanks for good tutorial.By the way,you are beatiful

  • @revel0525
    @revel0525 Жыл бұрын

    What should I do next?

  • @utkarshtekwani1039
    @utkarshtekwani1039 Жыл бұрын

    please uplodad dsa of C language too

  • @7amoodbasha934
    @7amoodbasha934 Жыл бұрын

    Actually your content is the best butI hope so you make a real system to pratice rather than a seprate examples

  • Жыл бұрын

    I miss explaining the difference between [0] and .at(0). [] doesn't check if the value it's valid and .at() does, throwing an exception if it's past the size of the vector.

Келесі