知识点
1 std::vectorstd::string 作为返回参数
void GetConfigState(std::vectorstd::string&vtTemp)
2 对于std::vectorstd::string取值操作
std::vectorstd::string::iterator theIterator;
for( theIterator = vtTemp.begin(); theIterator != vtTemp.end(); theIterator++ )
cout<c_str()<<endl;//这样取值
3 不能直接进行容器间赋值
#include
#include
using namespace std;
void GetConfigState(std::vectorstd::string&vtTemp)
{
unsigned int nLen = 0;
unsigned int nValue = 0;
std::string strType_Item;
std::string strType_Items;
std::string strTemp =“AT+CFUN=1;AT+CFUN=0”;
int nPos = strTemp.find(“;”,0);
int j = 0;
while (nPos != -1)
{
vtTemp.push_back(strTemp.substr(0,nPos));
nPos ++;
strTemp = strTemp.substr(nPos,strTemp.length() - nPos);
nPos = strTemp.find(“,”,0);