C++ vector of char array

后端 未结 7 914
梦谈多话
梦谈多话 2020-12-09 16:06

I am trying to write a program that has a vector of char arrays and am have some problems.

char test [] = { \'a\', \'b\', \'c\', \'d\', \'e\' };

vector

        
7条回答
  •  不知归路
    2020-12-09 16:36

    Use std::string instead of char-arrays

    std::string k ="abcde";
    std::vector v;
    v.push_back(k);
    

提交回复
热议问题