fork download
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. std::istringstream stm( "a\tb\tc\nanother_line\n" ) ;
  8. std::string str ;
  9. std::getline( stm, str ) ;
  10. for( char c : str )
  11. {
  12. if ( c == '\t' ) std::cout << "<TAB>" ;
  13. else std::cout << c ;
  14. }
  15. std::cout << '\n' ;
  16. }
  17.  
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
a<TAB>b<TAB>c