The '%s' modifier of printf takes a char* , not a std::string . You can write: sprintf(command,"echo \"something with a string %s\" ", stringz.c_str());.
確定! 回上一頁