fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. main(){
  7. string b = "Karde ale wtopa";
  8. char c;
  9. c = 'a'; // char (a) = 97
  10. size_t pozycja = b.find(c);
  11. while(pozycja != string::npos){ //// ; <-- co ten średnik tu robił ????
  12. b.erase(pozycja,1);
  13. cout << pozycja << ' '; //dla sprawdzenia
  14. /* size_t szukaj*/ pozycja = b.find(c);
  15. }
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1 5 12