It's known to everyone of us that we should prefer string
class in C++
for all string applications due to the many special functions they perform & their ability to grow & reduce dynamically. What string
is for characters
, vector
is for other data types & classes because it shows great performance.
However is there any situation where we would need to prefer vector<char>
(which I see seldom) over string
?