In the next code:
#include
int main(void) {
int c;
while ((c=getchar())!= EOF)
putchar(c);
return 0;
}
yes you can do this on windows too, here's the code below, using the conio.h library
#include //basic input/output
#include //provides non standard getch() function
using namespace std;
int main()
{
cout << "Password: ";
string pass;
while(true)
{
char ch = getch();
if(ch=='\r'){ //when a carriage return is found [enter] key
cout << endl << "Your password is: " << pass <