fork download
  1. #include <iostream>
  2. #include <set>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. namespace cppfsm {
  8. /* constants */
  9. // character classes:
  10. string s_alpha = "This text Will Become sorted, and duplicate letters will appear once.";
  11. const set<char> alpha(s_alpha.c_str(),s_alpha.c_str()+s_alpha.length());
  12. }
  13.  
  14. int main()
  15. {
  16. for (set<char>::const_iterator cit = cppfsm::alpha.begin();
  17. cit != cppfsm::alpha.end();
  18. ++cit
  19. )
  20. cout << *cit << ' '; // display each character
  21.  
  22. cout << endl; // newline
  23. }
  24.  
Success #stdin #stdout 0.01s 2860KB
stdin
Standard input is empty
stdout
  , . B T W a c d e h i l m n o p r s t u w x