如何解析字符串 [英] How to Parsing a String
本文介绍了如何解析字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好.
如何将字符串解析为str?
Hello.
How to parsing a string as str?
stringstream strs;
strs<<"U@1"<<"Vec@(2,4)";
string str = strs.str();
/*
* How to parsing the str ?
*/
感谢您回答我的问题.
Thanks for answering to my question.
推荐答案
u将使用函数string :: c_str()获得char *,可将其与sscanf函数一起使用,以方便解析. .
希望这会有所帮助..
jkchan
http://cgmath.blogspot.com [ ^ ]
u will get the char* using function string::c_str(), which can be used with sscanf function for easy parsing..
Hopes this helps somewhat..
jkchan
http://cgmath.blogspot.com[^]
这篇关于如何解析字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文