使用stringstream流(已验证)
引入头文件
#include <sstream>
功能实现:
string keyValue = "WTH01#WTH02#WTH03#WTH04#WTH05"
string keys[6] = { "" };
stringstream is(keyValue);
string temp;
int index = 0;
while (getline(is, temp, '#'))
{
keys[index] = temp;
index++;
cout << temp << endl;
}
结果图
**************************************************************************************************************