fork download
  1. #include <iostream>
  2. #include<string>
  3.  
  4. using namespace std;
  5. void fun(string str)
  6. {
  7. static int a[256];
  8. int i=0;
  9. it=str.begin();
  10. while(it!=str.end())
  11. {
  12. if(a[*it]==0)
  13. {
  14. str[i]=*it;
  15. i++;
  16. }
  17. it++;
  18. }
  19.  
  20. }
  21. int main() {
  22. // your code goes here
  23. string str="jiofd djfodoi";
  24. cout<<str;
  25. return 0;
  26. }
Compilation error #stdin compilation error #stdout 0s 3428KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void fun(std::string)’:
prog.cpp:9:1: error: ‘it’ was not declared in this scope
 it=str.begin();
 ^
stdout
Standard output is empty