why is string s = (char*)tag.c_str(); is wrong when tag is a string

前端 未结 0 1197
野趣味
野趣味 2020-12-03 17:35

why is the following code is wrong ?

string tag = "hello"; string s = (char*)tag.c_str();

what does this mean: storing addresses

相关标签:
回答
  • 消灭零回复
提交回复
热议问题