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:
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
This is from a small library that I found online: 开发者_运维百科const char* GetHandStateBrief(const PostFlopState* state)
This question already has answers h开发者_StackOverflow中文版ere: string c_str() vs. data() (6 answers)