Cast a vector of std::string to char***

前端 未结 2 508
野趣味
野趣味 2021-01-29 01:29

I have an API function that expects a char*** parameter and want to pass a vector. Are there member functions of std::string

2条回答
  •  有刺的猬
    2021-01-29 02:11

    "Are there member functions of std::string that let me do that?"

    In short: No.

    That std::vector stores the std::string instances in a contiguous array, doesn't mean that the pointers to the underlying char arrays of these string instances appear contiguously in memory.

提交回复
热议问题