search

Home  >  Q&A  >  body text

c++ - 结构 std::queue 丢失 const char* 数据

迷茫迷茫2807 days ago732

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 13:48:11

    This is std::string. After the function call is completed, tmpString is destructed and the allocated data will be deleted.
    Since you want to use string, token_node should also use std::string, or it is best to use a heap-allocated char array directly.

    reply
    0
  • Cancelreply