The video is very clear to explain and demonstrate vector. Thank you for your teaching. I can understand your lectures. but at the university, I often feel lost in class.
@JzBosco Very similar to an array, but a vector can dynamically grow and shrink. Behind the scenes a vector is just an array - if we need more space, a new array is created, the old array is deleted and the new array is referenced. I don't have a particular book that I would recommend to go along my videos, but there are several really good C++, Intro Programming/Problem Solving and Data Structures books out there... Stanford's CS106B is a good Data Structures course using C++.
***** as i said before ENGLISH IS NOT MY FIRST LANGUAGE ,by "COMPLETLY LEARNED IN A WEAK" i didnt mean that I would've literaly learned c++ in a weak.(as a student of software engineering major) all i was saying was that if he was our professor, it could've been easier for me to learn faster. bcz his teaching method is way better than the professors at my university. AND NO I...AM...NOT...CRAZY!!! :)
@JzBosco I have about 15 or so data structures books and that is my favorite. I didn't know Stanford provided the first 13 chapters on the 106B site. The examples and explanations provided by Roberts are fantastic. Some people complain about the quality of the printed edition since it appears photocopied from an original source, but the content is gold.
It's so crystal clear! thank you so much!! EDIT: is there anything I should watch out for here since newer versions of c++ have gone out? Thanks for answering..
@JzBosco I just checked out the course reader and they have updated it for C++. It also looks like they will be publishing a new version of the book using C++ in the next year or so.
@JzBosco Bruce Eckel makes the older editions of his books (Thinking in C++, Thinking in Java etc) free. The cplusplus website with it's C++ language tutorial is really great.
I am a begnner myself. But I guess that it would be worth that I mension something important I read about vectors when it comes to efficiency. vectors are relatively fast at accessing any element in the list, it does not matter where whether it's the front, end or in the middle of the vector. It is also good at removing and adding elements at the end of the array. However, it is slower and worse when it comes to removing and adding elements in the middle or any random index in the array.
Nice vedios almost everything about vector that is used generally is explained in this vedio, but you left one important function i.e. pop_back() ; function present in vector class. At last great explanation.
Hello I need some help. So i need to do a similar thing as this as I am working out value at risk but I have been given 1284 series of prices to load data which I have done. so would I do Vector data(1284)? the series dont go from 1-1284 that is just the size, the actual numbers are different so for e.g: 1 = 1283 2= 1794 3= 1766 . . 1284= 1681.067
Thank you for the video. Better approach however to use iterator over the vectors. First you need to assign iterator to a vector vector::iterator it; and then use it for going through the vector for(it = v.begin(); it != v.end(); it++) {} It is preferred, because in comparison with Java we do not know the indexes of elements in the vector at run time. Basically it is more dynamic :) CheersPlusPlus
How the heck do you have the code print to a console in the program?? My code prints to a cmd window outside of Visual Studio and for the life of me, I can't figure out how to switch it..
It's basically the same thing, he just has his console inside the compilator but that is because eclipse (the program he's using) is made that way. Btw if you are using visual studio you are probably programming in visual c++ which has some small differences with the one he is using.
Looking back over a year ago posting now, yeah I'm pretty sure It is eclipse as well. And yes, I use visual c++ but use netbeans for java stuff. It's still annoying with visual studio but the benefits outweigh the console issue so it is what it is.
I know everything already i was here to know that :- if memory location first element of array is memory location store in name of array than what is store in vector variable name???????
how do i make an array in which the values are inputed by the user and which can carry as many values as it can and the values can be modified and calculated(like sum,division multiply etc). or it cant be made ?? someone plz answer. lang : python, c++
deep mondal Well python it's easy it's just t = [] while True: a = input(": ") if a == "q": break else: t.append(a) print(t) but in C++ you'll have to make a vector and instead of using t.append() like in python you'll have to use t.push_back().
deep mondal Did you not try any of the forums? UA-cam REALLY isn't the place to ask this stuff as all the guys who know what they're doing use proper forums. If you got any other questions you can always ask me on discord if you want by the way.
write a C++ program to initialize two vectors that are found in the following sets: A={1,5,7,3,-8,-4,9,6,-7,2} and B={5,8,4,2,5,3,7,-7,-9,2} can you solve this for me please ?
What if your vector has more elements than the largest int? It wouldn't compute. The BEST way to do this is through an iterator, but that was beyond the scope of the video.
size_t represents "maximum size of a theoretically possible object of any type" and is implementation-defined. It's mostly used when you don't know how many of something you'll have, such as elements in a vector.
Nice.. Is there a way I can store the first 3 values of this standard vector into a Vec3f, which is basically x, y, z.. So in just one line(with a 'for' loop) I wanna store first 3 values into a single Vec3f type vector.. something like---- in for loop--- Vec3f startPoint = vector homeVector.. Please help
youre really amazing and you've helped me more than my professors and most books..
The video is very clear to explain and demonstrate vector. Thank you for your teaching. I can understand your lectures. but at the university, I often feel lost in class.
@JzBosco Very similar to an array, but a vector can dynamically grow and shrink. Behind the scenes a vector is just an array - if we need more space, a new array is created, the old array is deleted and the new array is referenced. I don't have a particular book that I would recommend to go along my videos, but there are several really good C++, Intro Programming/Problem Solving and Data Structures books out there... Stanford's CS106B is a good Data Structures course using C++.
Finally get vectors. In all articles and websites I read about them, no one put them in a real world application to help me visualise :O Thanks! :D
if you sir were my teacher at university i would've completely learned C++ in a weak.and thank you so much for these great videos.
bluemoon0946 You hopefully would have learned how to spell also.
Christopher Ruf maybe! and english is not my mothertounge.so yeah i may make some mistakes when it come to writing!!!!!
***** as i said before ENGLISH IS NOT MY FIRST LANGUAGE ,by "COMPLETLY LEARNED IN A WEAK" i didnt mean that I would've literaly learned c++ in a weak.(as a student of software engineering major) all i was saying was that if he was our professor, it could've been easier for me to learn faster. bcz his teaching method is way better than the professors at my university.
AND NO I...AM...NOT...CRAZY!!! :)
***** NO PROBLEM. :)
+Christopher “Logan” Ruf you are a douchebag.
@JzBosco I have about 15 or so data structures books and that is my favorite. I didn't know Stanford provided the first 13 chapters on the 106B site. The examples and explanations provided by Roberts are fantastic. Some people complain about the quality of the printed edition since it appears photocopied from an original source, but the content is gold.
Sir thank you so much for explaining what a vector is and how it works 4:39
Clear and simple, thank you.
You, sir, did a real classy job, I would've gone nuts over this topic...
Thank you very much...
It's so crystal clear! thank you so much!!
EDIT: is there anything I should watch out for here since newer versions of c++ have gone out? Thanks for answering..
its for real ... real learning, I never comment on YouTobe videos but this one really thought me something . thanks keep it up bro.
tnx for the video....student from a remote part of Bangladesh
All good. Learned a lot from this vid. Gonna practice vectors tommorow.
Best explanation on youtube! Thank you very much. :)
Thanks, I'm learning about ray tracing and many of the sample programs are in C++.
@JzBosco I just checked out the course reader and they have updated it for C++. It also looks like they will be publishing a new version of the book using C++ in the next year or so.
best teacher are hard to find like you 😍
Absolutely wonderfully explained! Great job! Thanks!
Thank you so much. Much needed. Very easy to follow along.
great tutorial -- hoping more people who need to figure out c++ can discover ReelLearning
Excellent videos. Thanks.
can you specify the size of the vector with a variable, like pos(as in postition)? Like this: vectorv(pos).
@JzBosco Bruce Eckel makes the older editions of his books (Thinking in C++, Thinking in Java etc) free. The cplusplus website with it's C++ language tutorial is really great.
What's the point of vectors when arrays already exist, even dynamic arrays?
Vectors are more dynamic
Some IDEs doesn't support dynamic arrays.
If you really wanted to throw employees and disks together you could use a union. In case anybody was wondering:) love the videos!
Video was short ,sweet &simple .but i would recommend more detailing in coding tips
I am a begnner myself. But I guess that it would be worth that I mension something important I read about vectors when it comes to efficiency. vectors are relatively fast at accessing any element in the list, it does not matter where whether it's the front, end or in the middle of the vector. It is also good at removing and adding elements at the end of the array.
However, it is slower and worse when it comes to removing and adding elements in the middle or any random index in the array.
nicely explained thank you very much
Nice vedios almost everything about vector that is used generally is explained in this vedio, but you left one important function i.e. pop_back() ; function present in vector class. At last great explanation.
How is the push back operation helpful? it's just as easy to replace v(3) with v(4) and add the new value.
Plzz make video on scalar
Hello I need some help. So i need to do a similar thing as this as I am working out value at risk but I have been given 1284 series of prices to load data which I have done. so would I do Vector data(1284)? the series dont go from 1-1284 that is just the size, the actual numbers are different so for e.g:
1 = 1283
2= 1794
3= 1766
.
.
1284= 1681.067
Nice explanation. Keep going....
Thank you for the video.
Better approach however to use iterator over the vectors. First you need to assign iterator to a vector vector::iterator it;
and then use it for going through the vector for(it = v.begin(); it != v.end(); it++) {} It is preferred, because in comparison with Java we do not know the indexes of elements in the vector at run time. Basically it is more dynamic :) CheersPlusPlus
this saved me!! understanding by 10:09 for what I need!!
Really well explained, thanks!
there are many question, in c++ when you try to get the first character you must type vec[0][0] but why double dimension applied
What if i wanna change value? But keep the name? Should i keep vector and then put map on it , or use "map [3] = 1" ?
How can you attach the contents of a vector into a string?
Here's a pseudocode: "cout
what is difference between v[0] and v.at(0); ?? is v.at(0){return v[0]} anything like that?
How the heck do you have the code print to a console in the program?? My code prints to a cmd window outside of Visual Studio and for the life of me, I can't figure out how to switch it..
It's basically the same thing, he just has his console inside the compilator but that is because eclipse (the program he's using) is made that way.
Btw if you are using visual studio you are probably programming in visual c++ which has some small differences with the one he is using.
Looking back over a year ago posting now, yeah I'm pretty sure It is eclipse as well. And yes, I use visual c++ but use netbeans for java stuff. It's still annoying with visual studio but the benefits outweigh the console issue so it is what it is.
You can print to the output window in visual studio, you just need to use OutputDebugString() msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx
Can you have a vector of vectors?
Yes. For example two dimensional vectors are created doing that: vector arr2dim;
You sir are out of your vector.
Only if you include the Vectorception library.
@@Idan-tc5rt not really, you could use pointers
thank you very much sir, your tutorials are awesome...
Thank you for making my life easy.
U made your life tough yourself.U should have helped Fugaku with the coup de tat.
Thanks for such great demonstration. Understood the basics! :) Keep up the good work.
Thank you . You are a great teacher.
how can I implement the function "insert" for vectors?
So vector is basically advanced array?
+azaruto It is in every way a superior array. Never use standard dynamic arrays unless you have a good reason to.
Don't you use them to initialize vectors?
that what I thought about.. what's special about vectors then ?
wonderful tutorials, thank you
I know everything already i was here to know that :- if memory location first element of array is memory location store in name of array than what is store in vector variable name???????
So...what is the difference between this (vector) and an array?
is it passed by value or reference because array are passed by value. shouldnt it be same ?
How do you handle the last error?
I finally understand vectors!
at 14:40 I was screaming "YOU FORGOT THE SEMICOLON! DON'T BUILD! WAITTT!!" and he builds and is like "Uh what...Oh, semicolon..."
how do i make an array in which the values are inputed by the user and which can carry as many values as it can and the values can be modified and calculated(like sum,division multiply etc). or it cant be made ?? someone plz answer.
lang : python, c++
Well which laungage do you want it in?
python or c++ or both.
deep mondal Well python it's easy it's just
t = []
while True:
a = input(": ")
if a == "q":
break
else:
t.append(a)
print(t)
but in C++ you'll have to make a vector and instead of using t.append() like in python you'll have to use t.push_back().
InterCo - interface212 thanks man for the solution. :) this think was bugging me for days.
deep mondal Did you not try any of the forums? UA-cam REALLY isn't the place to ask this stuff as all the guys who know what they're doing use proper forums. If you got any other questions you can always ask me on discord if you want by the way.
Loved it!
which ide is this?
whatis the difference between vector and array? they look the same
Vectors are a dynamically allocated array. Just a tad bit better than a regular array.
Can you use vectors in Deterministic code for devices in hospitals where a memory issue can kill people? We can use a predefined array ;)
Thank you! much appreciated 😊😅
write a C++ program to initialize two vectors that are found in the following sets: A={1,5,7,3,-8,-4,9,6,-7,2} and B={5,8,4,2,5,3,7,-7,-9,2}
can you solve this for me please ?
I don't understand how b is referencing the index of v.
Thanks helped me a lot
4:57 nice voice crack bro
Thanks this was helpful!
Thank you very much sir.
you can't just use int i, you have to use unsigned int i
Hi why is that so? Just wondering about size_t
What if your vector has more elements than the largest int? It wouldn't compute. The BEST way to do this is through an iterator, but that was beyond the scope of the video.
size_t represents "maximum size of a theoretically possible object of any type" and is implementation-defined. It's mostly used when you don't know how many of something you'll have, such as elements in a vector.
You can use it as signed too. But if you want to be pedantic you should use your own typedef that account for architecture difference.
can u plz tell which ide u r using
Eclipse.
A great video it was
Touchscreen?
Are you using an IDE?
AkshaySrinivasan he's using eclipse
Kids, don't pass vectors to functions by value as he did. And use const whenever appropriate.
If you need a double to store your rainfall you are very wet indeed.
Nice.. Is there a way I can store the first 3 values of this standard vector into a Vec3f, which is basically x, y, z..
So in just one line(with a 'for' loop) I wanna store first 3 values into a single Vec3f type vector.. something like---- in for loop--- Vec3f startPoint = vector homeVector..
Please help
Thank you verry much!
thank you
at 1.5 playback rate is perfect
thanks
Thanks for video, it was very useful
By the way, we could also use in that loop cout
Thank you so much :)
ɷɷɷ Heeyy Friends I Have Founddddd Working Online Hacck visitttt : - t.co/q8S0s6FHf2
I think I should go and learn math again !
how the hell do you write like that with a mouse?
I thought elements began at index zero.
they do
Bien
why doesn't my professor explain stuff like this..
everything is perfect expect for the fact that you're not Indian
Nah makes it better
Compared to this guy, I'm out of my Vector. . . . .
good but tooo long
Thanks for not being Indian.
Dude stfu.
I don't believe people who write using their mouse cursor
What is the difference between vector and array?