#include #include #include #include int main(int argc, char *argv[]) { // std::this_thread::sleep_for(std::chrono::milliseconds(150)); // Output for read test. if (argc == 2) { // Write a single line and exit. if (std::string(argv[1]) == "write") { std::cout << "This is a test"; std::cout.flush(); return 25; } // Exit without writing anything. if (std::string(argv[1]) == "quit") { return 25; } } char ch; while (std::cin >> ch) { // Exit? if ('q' == ch) { break; } std::cout << (char) std::toupper(ch); std::cout.flush(); } return 25; }