将字符串分配给变量intifier? [英] Assign string to variable indetifier?

查看:112
本文介绍了将字符串分配给变量intifier?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何转换这样的字符串"nodeA:valueA | nodeB:valueB |...."排列或映射[已解决],

然后使用指针和值循环数组,并使用指针分配下面的nodeA和valueA [仍在努力寻找答案]?

int nodeA = net.FindNode("nodeA");
neet.GetNode(nodeA)-> Value()-> SetValue(valueA);

谢谢.

How do I convert a string like this "nodeA:valueA|nodeB:valueB|...." to array or map [SOLVED],

then loop the array with key and value and assign nodeA and valueA below, using pointer[Still working hard to find answer]?

int nodeA = net.FindNode("nodeA");
neet.GetNode(nodeA)->Value()->SetValue(valueA);

Thank you.

推荐答案

如何转换这样的字符串"nodeA:valueA | nodeB:valueB |...."排列或映射

然后使用键和值循环数组,并使用指针在下面分配nodeA和valueA?

int nodeA = net.FindNode("nodeA");
neet.GetNode(nodeA)-> Value()-> SetValue(valueA);
How do I convert a string like this "nodeA:valueA|nodeB:valueB|...." to array or map,

then loop the array with key and value and assign nodeA and valueA below, using pointer?

int nodeA = net.FindNode("nodeA");
neet.GetNode(nodeA)->Value()->SetValue(valueA);

考虑std :: string和std :: map的组合.

Consider a combination of std::string and std::map.

具有一些贯穿初始字符串的内容(也许是std :: string :: find的循环),并将每个值放入std :: map< std :: string,std :: string>中.

Have something that runs through the initial string (perhaps a loop of std::string::find), and put in each value into a std::map<std::string, std::string>.


这篇关于将字符串分配给变量intifier?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆