Wait wait wait. You're not hoping to assign an std::vector<int> or std::list<int> to a single int, are you? If so, you're going to have some trouble making it work in that direction.
He means that you cannot do much more than set the default size of the vector being used as a variable, and if you want fill all its spaces with one value.
You can tell it to reserve a certain amount of space on construction and then you can tell it to give each reserved slot a default value. That's really the best possible you can do with the constructor.
1st argument - The size you want the vector to be
2nd argument - No it isn't. It is what you want to "filled" stuff to be, i.e. if you put a size of 3 and put 5 as the second argument, you would get a vector with three 5s in it.
3rd argument - Something you probably won't need to change or care about
I think i should ve framed the question a little different..
2nd argument -
Alrite.. but what does this stand for?
const T& value= T()
What ll happen if I use it in a function i write?? I am trying to understand the way the prototype itself is declared
3rd argument - Something you probably won't need to change or care about
Yeah.. But what is it?
2nd arg - It means it takes a const T value by reference with the default being a defaultly constructed T. T being whatever type you are putting in the vector.
3rd arg - It tells the vector where and how to allocate and delete it's memory. So you could partition some memory yourself and give it to the vector (assuming you have created an allocator for it)
If my understanding is rite about the third argument,
Point 1
=====
The third argument could be used in case if I want to write my own fucntion for allocation. In that case I should pass the name of the function ( when I pass the name, i assume that the address of the function is passed)
Point 2
=====
Both 2nd and 3rd arguments are default arguments..