不能直接这样做,因为没有对底层缓冲区的写访问权限。你必须首先在c-string中完成,然后把它复制到std :: string中: char buff[100]; snprintf(buff, sizeof(buff), ...
確定! 回上一頁