Does anyone know what is the main difference between Vector Template and List Template.
It seems to me quite similar....maybe It's just that list can be access to any point straight...I know I coudl read the documentntion but I would need like a Highlight!!
Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays.
Internally, vectors use a dynamically allocated array to store their elements.
maybe It's just that list can be access to any point straight...
If I understand you correctly, it's the other way round.
With a vector you can use operator[] to access any element directly (by index). Because, as jlb said, vector is a random access container.
With list you got to start with the head or tail element and then walk the list elements until you get to the one you want. Because list is a sequence container.
Earlier this year I went for 5 job interviews in the space of two weeks. Interestingly (or maybe not) three of those companies asked me this question :)
Mutexe It's not related to an intereview but It's similar....I have selected several questions that are important to have a reasonable undertanding of C++, and I studing C++ following thoses "main things",but It's good to know it....