vector<char> vec{'h','e','l','l','o',',','w','o','r','l','d'};
ostringstream os;
os << &*vec.begin();
string a=os.str();
获取到的os含有容器内未使用空间的数据,假设需要用string接收多个容器内容。
这种读取到多余数据的结果如何避免?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。