I'm making a Project on a Travel Agency and I need to hide the password entered by the user! I am working on Xcode 5.1.1 -> Command Line Tools -> C++ on my MacBook Pro! Here is what I've tried --
1 2 3 4 5 6 7 8 9
|
string pass ="";
char ch;
cout << "Enter pass\n";
ch = getchar();
while(ch != 13){//character 13 is enter
pass.push_back(ch);
cout << '*';
ch = getchar();
}
|
AND
1 2 3 4 5 6 7 8 9
|
string pass ="";
char ch;
cout << "Enter pass\n";
ch = getch();
while(ch != 13){//character 13 is enter
pass.push_back(ch);
cout << '*';
ch = getch();
}
|
But in the first case the display is -
//Assuming the password is Hello
Hello
******
And in the second its giving me 3 errors -
1. Apple Mach-O Linker(Id) Error
"_stdscr", referenced from:
2. Apple Mach-O Linker(Id) Error
"_wgetch", referenced from:
3. Apple Mach-O Linker(Id) Error
clang: error: linker command failed with exit code 1 (use -v to see invocation)
PLEASE HELP ASAP :D Project due on Friday and i'm still on the login page!!!