   trying to find "\"
  Jo ppl,what a pain. I just tried to use the GetOpenFileName() function which works just fine. The result I put into a std::string and try to filter the path cause I don''t need it. Just have to get the position of the last slash in the string and use substr but using Find_last_of() and passing "\" doesn''t work (obviously).Any workarounds ?Thanks in advance.Lorenz 
  Use the escape sequence ''\\''. The compiler will see it as a single backslash char. Others:\'' = ''\" = "\0 = null char;  Thanks ! ;  You use an escape sequence, '\\'. Something like this: #include <iostream>#include <string>#include <cstdlib> bool FilterPath( const std::string& path, std::string& file ); bool FilterPath( const std::string& path, std::string& file ){    std::string::size_type pos = path.find_last_of( '\\' );    if ( pos == std::string::npos )   return false;    // else    file = path.substr( pos + 1 );return true;} int main(){    std::string path = "C:\\My Program\\sausage.exe";    std::string file;...FilterPath( path, file );    std::cout << file << std::endl;    ...system("PAUSE");return 0;} [ Google || Start Here || ACCU || STL || Boost || MSDN || GotW || MSVC++ Library Fixes || BarrysWorld || E-Mail Me ] [edited by - Lektrix on July 31, 2003 8:51:11 AM]