c-str
What is the lifetime of the result of std::string::c_str()?
In one of my programs, I have to interface with some legacy code that works with const char*. Lets say I have a structure which looks like:[详细]
2023-03-15 11:24 分类:问答Setting a char array with c_str()?
char el[3] = myvector[1].c_str(); myvector[i] is a string with three letters in. Why does t开发者_JAVA技巧his error?It returns type char* which is a pointer to a string. You can\'t assign this direc[详细]
2023-03-04 03:31 分类:问答Returning 'c_str' from a function
This is from a small library that I found online: 开发者_运维百科const char* GetHandStateBrief(const PostFlopState* state)[详细]
2022-12-27 00:04 分类:问答What's the difference between std::string::c_str and std::string::data? [duplicate]
This question already has answers h开发者_StackOverflow中文版ere: string c_str() vs. data() (6 answers)[详细]
2022-12-08 12:54 分类:问答