+ 1

Can in C++ we take input from user without getting printed on screen

Like if a user press a key it get stored in memory but cannot be seen on screen

27th Jun 2018, 3:47 PM
Abhishek Kumar
4 Answers
+ 2
hmm well........ I thought you were asking for turbo c++ however getch() can also be used in codeblocks, there is no such issue regarding that. EDIT: you can use getch(); in codeblocks without including the library <conio.h>
27th Jun 2018, 4:45 PM
RZK 022
RZK 022 - avatar
+ 1
Rosy so is it not possible to hide the input that could be done in turbo using getch()
27th Jun 2018, 4:06 PM
Abhishek Kumar
+ 1
well, turbo c++ is just obsolete now, but still... you can not hide any input you get in turbo c++ in a normal way but you can simply use clrscr(); for example : cout << "Enter a number : "; cin >> n; clrscr(); cout << "Enter another number : "; clrscr(); ...... and so on EDIT: if you just want to get a key then use: char ch; ch = getch(); this won't display the key on screen.
27th Jun 2018, 4:17 PM
RZK 022
RZK 022 - avatar
+ 1
Atikrant Negi {Gamma} yup, I know well about that in turbo. That's why I asked to know if there is a way for other platform like codeblocks or Linux
27th Jun 2018, 4:43 PM
Abhishek Kumar