Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <windows.h>
- int main()
- {
- HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
- DWORD mode = 0;
- GetConsoleMode(hStdin, &mode);
- SetConsoleMode(hStdin, mode & (~ENABLE_ECHO_INPUT)); // change to no input
- std::string s;
- std::getline(cin, s);
- std::cout << s << std::endl;
- SetConsoleMode(hStdin, mode & (~ENABLE_ECHO_INPUT)); // return back to normal
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement