fork(3) download
  1. #include <iostream>
  2. #include <cctype>
  3. #include <cstdlib>
  4.  
  5. int main()
  6. {
  7. const int kMaxLength = 256;
  8. char s[kMaxLength];
  9.  
  10. std::cout<<"Enter line:";
  11. std::cin.getline(s,kMaxLength);
  12.  
  13. char* c = s;
  14. for( char* p = s; *p; p++ )
  15. {
  16. if( std::isalpha(*p) )
  17. {
  18. *c = *p;
  19. c++;
  20. }
  21. }
  22. *c = '\0';
  23.  
  24. std::cout << s << std::endl;
  25. std::system("pause");
  26.  
  27. return 0;
  28. }
Success #stdin #stdout #stderr 0s 3344KB
stdin
12helloФедя023world8
stdout
Enter line:helloworld
stderr
sh: pause: not found