C++ 的 std::string 物件是儲存字串資料的面向物件方法,它可以動態增長,因為它實現了與 STL 向量相同的許多函式。與使用 '\0' 終止字串資料不同,您可以查詢其 strVar.size() 函式。
std::string
'\0'
strVar.size()