STL Containers - std::array, std::vector

I was going through the STL and I found that it has a container - std::array.
How is this different from the raw arrays we get in C++ and does it have any advantages/disadvantages.
Also is it better to use std::vector instead of an array when an array can be used?


std:: array is a container for constant size arrays
std:: vector is for dynamic arrays

Yes but is there an advantage of using vectors even when our content’s size is static?

Its always handy to have more methods at your disposal