Is it possible to store multiple strings in a vector?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emily53
    New Member
    • Nov 2011
    • 1

    Is it possible to store multiple strings in a vector?

    Hi, I'm pretty new to coding in C++, and I'm just wondering if its possible to store multiple strings in a vector, kind of like an array?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    A vector is an array so the answer is yes.

    If you define an array and then write functions to manage the array all you are doing is duplicating the vector code. The C++ standard requires a vector to be implemented as an array.

    Comment

    Working...