CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Threaded View

  1. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: String.Find() not working ...

    Quote Originally Posted by ChadReitsma View Post
    That's not pseudo man, it's exactly what I'm using... here let me post it:
    Code:
    //Extract the Angle data from the Buffer
    //IMU Outputs:
    //X:-0.36Y:0.29Z:-176.93!!!
    
    std::string comData, gyroX, gyroY, gyroZ;
    size_t xpos;
    
    comData = szBuffer;   //comData  = X:-0.36Y:0.29Z:-176.93!!!
    comData = comData.substr(0, comData.find_first_of("!") );   //Strips out the last !!! so we are left with comData = "X:-0.36Y:0.29Z:-176.93"
    
    xpos = comData.find("X:");
    look where I use find_first_of("!")... that works perfectly... so why doesn't find("X:") work on the string???
    And where is the "trace" you mentioned in your previous post?
    And how did you find out that "that works perfectly"? Did you debug your code or not?
    Last edited by VictorN; April 5th, 2012 at 04:29 AM.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured