|
-
April 5th, 2012, 03:35 AM
#1
String.Find() not working ...
Hi guys, sorry - I posted this in another thread but realized it should be in it's own...
Here's what's up.
I have a string that I have set up like this:
std:string comData;
and comData contains this: "X:0.59Y:0.42Z:-171.80"
Now, I need to know the positions of X: , Y: and Z: in that string so I tried using find() like this:
Code:
size_t xpos, ypos, zpos;
xpos = comData.find("X:");
ypos = comData.find("Y:");
zpos = comData.find("Z:");
Which I would expect to return: 0, 6, 12
But C++ has stumped me again - the variables xpos, ypos and zpos are empty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|