fork(1) download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. int findLastPos( std::string s, char c )
  5. {
  6. return s.rfind( std::string(1,c) );
  7. }
  8.  
  9. using namespace std;
  10. int main()
  11. {
  12. std::string s = "This is a long string with many other \"characters\". Hehehe";
  13. cout << findLastPos(s, '"');
  14. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
49