>I want to know what is allocator in C++ STL exactly ?
An allocator doles out blocks of memory using a standardized interface so that we can switch the allocation method quickly and easily. For example, we can go from using the standard allocator to using a memory pool simply by plugging in a different allocator class. The std::allocator class is the default allocator which uses new and delete .
>For example what is the difference between the two following statements
The first is correct, the second is broken. The first line is actually redundant. That's what happens by default anyway. The second line is kind of stupid because you're specifying an allocator for a different size type than the items stored in the vector.