Thank you so much, Tim! This C++ study is the best series from this channel, at least for me. Also more basics of ... could I say, a computer science, would be awesome.
Vectors are important. I brushed passed it in CS 2 cause i was so focussed on pointers and still am cause pointers are a beast lol. However, its something I'm taking more time in and learning because the fact is when you do a lot of these hackerank assessments or leetcode problems. Vectors are what you need to know to solve the problems. I was so confused when first trying some problems because I had the right mindset but an array wont cut it. Its as you said, regular arrays are good for when you know what you need. it has to have a static and constant size. Which is good in theory for a lot of problems but the problem is there a lot it isnt good enough as well
Hey Tim, your videos have been a great help! Thank you. I seen that during the vid you were looking at your notes to ensure which functions to utilize for the code. Would you mind sharing the source of the information you use for your code and your c++ tutorials in general?
so at 4:45 instead of getting the 8 to 16 kind of thing, my size was 10 and my capacity was 13.... really weird... and it started at 4, then 9, then 13 and when the size is 14 the capacity is 19 so weird.
So what's the difference between vector x(size) and int *x = new int[size]. If you where you where to only set the amount of space needed once and not change it both would essentially do the same but is one better?
they are basically the same but just dynamic arrays use built in language feature but vectors are a separate library or a class that is made with c++ with some functions that makes life easier so you don't have to reinvent the wheel every time.
you can also iterate through a vector using, for example: for(int i : [vector name]) {} this will iterate through the vector, and will automatically assign i the value at the place in the vector
I have several questions that needs answering: 1) I dont understand the part where inside the for loop that iterates through the vector container, you define the auto itr = v1.begin() and when you ran the program, the compiler error popped up and you said you had to dereference the pointer. How do u know it is a pointer ? 2) can I apply this method of insert and erase function in C++98? or do i need to update it to the latest version of C++ ? Overall, your C++ tutorial video is incredibly amazing and I really appreciate the amount of effort you've put into making this video. Thank you dude !
I do not understand why do you say arrays are inmutable in lenght, I tried to create an array with a defined length from the beggining not letting the array to be undefined in lenght and it perfectly lets you add however items you want...
In vector, the capacity will double if a new element is added. so first, after the capacity exceeds 4, it becomes 8. And when he added more values, when the capacity exceeds 8 it'll just get doubled. So it is 16!
you shouldn't teach people to use namespace std... especially not in tutorials for beginners. Using this namespace is one of the most common sources for errors and bugs and its so easy to avoid
some people just want stuff in a video format instead of reading it, not a big deal considering so many channels similar to this exist. Even bootcamps that cost thousands of dollars just get their stuff off of the internet :p
Thank you so much, Tim! This C++ study is the best series from this channel, at least for me. Also more basics of ... could I say, a computer science, would be awesome.
🇱🇹🇱🇹🇱🇹🇱🇹🇱🇹
3rd method to iterate throught vector:
for (auto num : v1)
cout
man i was so stuck in a homework and you made me see the light, thank you so much
Could you please continue this series. Your way of teaching is truly amazing
bro waiting for 21 C++ tutorial ...bring it alive man...you are my hope :)
Hi Tim! Thank you for the vids! I'm a student and its so hard to learn at home but you're making it better for us. Thank you! :D
Tim inspired me to learn and teach coding. And I started my own thanks
But no one will see your programming tutorial when there are youtubers like Tech with Tim who provide high quality content.
@@zombiekiller7101 remember when Tim started there were other great youtubers, before I believe I will be able I just believe
I love vectors
I don't know what's vectors 😂
I wanna love it but I need to master it first. Its so intimidating
@@stopbysometimes7590 good luck
I fart on vectors
Thank you so much tim for this tutorial. I was just thinking about learning vectors and this video pops up. Could really use this in memory hacking.
I thought you only make python tutorials, but now this!!
A different method to insert:
int main()
{
std::vector v1 = { 1, 2, 3, 4 };
std::vector::iterator it = v1.begin();
std::advance(it, 2);
v1.insert(it, 5);
std::cout
Thank you so much!
Good summary, short and sweet. Thanks.
Vectors are important. I brushed passed it in CS 2 cause i was so focussed on pointers and still am cause pointers are a beast lol. However, its something I'm taking more time in and learning because the fact is when you do a lot of these hackerank assessments or leetcode problems. Vectors are what you need to know to solve the problems. I was so confused when first trying some problems because I had the right mindset but an array wont cut it. Its as you said, regular arrays are good for when you know what you need. it has to have a static and constant size. Which is good in theory for a lot of problems but the problem is there a lot it isnt good enough as well
ahah funny
This is a really good quick catch up!
We can insert a value in a vector directly by knowing its index. Like for a vector v1 -> v1[0] = 2;
@Peterolen oh ok, Thanks for telling :)
@@DRKongo-vi8ok i think he was replying to someone that deleted their comment
@@justin-ju4eo you should watch the full video
That overrides what is currently there, doesn't insert it into that position?
that wouldn't be an insertion, it would be replacing what is currently at v1[0]
Hey Tim, your videos have been a great help! Thank you. I seen that during the vid you were looking at your notes to ensure which functions to utilize for the code. Would you mind sharing the source of the information you use for your code and your c++ tutorials in general?
simple and useful. great. thank you!
Perfect as always
Thanks, Tim.
really helpful, thank you.
Awesome explanation, thanks
Very useful thank you very much you explained it really well
You are awesome Tim but could you do an algorithms C++ series after this.
Great Vid, Thanks!
You could use short hand for loop to iterate over collections
Thanks Tim!
Thank you, very helpful!
Thanks.
thank you!
so at 4:45 instead of getting the 8 to 16 kind of thing, my size was 10 and my capacity was 13.... really weird... and it started at 4, then 9, then 13 and when the size is 14 the capacity is 19 so weird.
Does v1.insert(v1.at(0), 5) would work?
So here you discuss about the one dimensional array of vectors right? But I wonder if there're any two dimensional vector arrays.
which compiler are you using?
Hi great vid👍, what kind of IDE you use for C++ in this video?
I think its sublime text
Thank you for the video. "vector.pop_back" does not return the element that was removed.
So what's the difference between vector x(size) and int *x = new int[size]. If you where you where to only set the amount of space needed once and not change it both would essentially do the same but is one better?
they are basically the same but just dynamic arrays use built in language feature but vectors are a separate library or a class that is made with c++ with some functions that makes life easier so you don't have to reinvent the wheel every time.
great video tips
great one...
what text editor is tim using in this vid
if I type vector v1, what does it mean?
makes a 2d vector
ex: v1={{1, 2}, {2, 3}}
thank a lot
you can offset the v1.begin() +( actual place you want insert ) like this :v1.insert(v1.begin()+5,1111));
What ide are you using please?
v1[2] = 6; to assign a (new) value to index 2 of v1
Hello Tim, I have a question.
How long does it take to me after I learned kotlin to program a dating app with it?
Txs Tim. but what tool do you use that compile in 8s. very fast. can you send me
you can also iterate through a vector using, for example:
for(int i : [vector name]) {}
this will iterate through the vector, and will automatically assign i the value at the place in the vector
What code editor you're using?
do you need to use encapsulation on vectors if they are in class?
what is your compiler bro?
how can we sort vector and print it??
What does the auto iteration
Is it another way of iterating through a vector.
[Error] in C++98 'my_vector' must be initialized by constructor, not by '{...}'
I have several questions that needs answering:
1) I dont understand the part where inside the for loop that iterates through the vector container, you define the auto itr = v1.begin() and when you ran the program, the compiler error popped up and you said you had to dereference the pointer. How do u know it is a pointer ?
2) can I apply this method of insert and erase function in C++98? or do i need to update it to the latest version of C++ ?
Overall, your C++ tutorial video is incredibly amazing and I really appreciate the amount of effort you've put into making this video. Thank you dude !
Thank you so much,
Hey tim, will you ever learn quantum computing languages?
Oh wow did ur clg teach that to u?
When is part 2 comming out for typibg race clone?
Is it just me that immediately thinks ‘OHHH YEAAHHH!’ when vectors are mentioned anywhere?
what is your IDE?
So basically I can use vector instead of static array, cool
bro how do you know so many things and able to make videos on each. So you must have a good understanding of these.
C++ should be having a standard linear algebra module
How this guy knows so many programming languages 🤔
Can you start a tutorial on ethical hacking
Hello, for a non-English speaker, you speak too quickly. However, the content is perfect!
Skill issue
3rd commenter and 40th viewer
I do not understand why do you say arrays are inmutable in lenght, I tried to create an array with a defined length from the beggining not letting the array to be undefined in lenght and it perfectly lets you add however items you want...
This dude have very less subscriber feeling bad 😢
Capacity is only increasing. The same as taxes...
bruh just uploaded video on yt without any preparation after getting out from washroom...and still getting views.
:)
mark
🔥🔥🔥🔥🔥🔥🔥Can h please make the code on VS Code please 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🎉🔥🔥🔥🔥🔥🎉
In the beginning I don’t understand why the output was 16 I understand the output 9 but not 16 where did the 16 come from
In vector, the capacity will double if a new element is added. so first, after the capacity exceeds 4, it becomes 8. And when he added more values, when the capacity exceeds 8 it'll just get doubled. So it is 16!
I didn't understand nothing about this lesson
you shouldn't teach people to use namespace std... especially not in tutorials for beginners. Using this namespace is one of the most common sources for errors and bugs and its so easy to avoid
I can't believe you've built a successful UA-cam channel based on stuf that's easily found on the web lol
some people just want stuff in a video format instead of reading it, not a big deal considering so many channels similar to this exist.
Even bootcamps that cost thousands of dollars just get their stuff off of the internet :p