I'm having a problem with extracting b2vec2 coordinates from a CCString these are from cocos2dx and box2d.
I have tried using strtk but i could not get it to work
Any help would be great.
Thanks
The Layout of the string is "x,y x,y x,y" i want to put the x and y's into an array of 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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With