Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在从 CCString 中提取 b2vec2 坐标时遇到问题,这些坐标来自 cocos2dx 和 box2d。
我试过使用 strtk 但我无法让它工作
任何帮助都会很棒。
谢谢
字符串的布局是“x,yx,yx,y”我想将 x 和 y 放入 b2vec2 的数组中
string s = "12,4 4,5 6,3"; istringstream is(s); while (is.good()) { int x, y; char comma; is >> x >> comma >> y; cout << x << ", " << y << endl; }