hiding

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2004
Posts: 14
Reputation: Tresa is an unknown quantity at this point 
Solved Threads: 0
Tresa Tresa is offline Offline
Newbie Poster

hiding

 
0
  #1
Nov 24th, 2004
can some please tell how can u hide whatever u are typing when typing in c++ exe. file?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 68
Reputation: harshchandra is an unknown quantity at this point 
Solved Threads: 1
harshchandra harshchandra is offline Offline
Junior Poster in Training

Re: hiding

 
0
  #2
Nov 24th, 2004
I didn't get ur point exactly........
However in c++ u can use getch(); .This will defenately take the character from the user but will not display over stdout.
For example : Think of typing a password.U type ur password but wht u see is merely a asterisk sign.Following code explains it better.
int k =5
do
{ character=getch(); /* These thing is done so that password is not visible*/
gotoxy(k,8) ;printf("*");
str8[i]=character;
k++;
i++;
}while(character != '.');
i--;
str8[i]='\0';
This will keep on entering a string to that array str8[] and will not display the original characters entered but instead of that will display a "*" till users presses a dot.
Instead of dot u can use any sentinel value as if ASCII charater of return key is 13.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 14
Reputation: Tresa is an unknown quantity at this point 
Solved Threads: 0
Tresa Tresa is offline Offline
Newbie Poster

Re: hiding

 
0
  #3
Nov 25th, 2004
Originally Posted by harshchandra
I didn't get ur point exactly........
However in c++ u can use getch(); .This will defenately take the character from the user but will not display over stdout.
For example : Think of typing a password.U type ur password but wht u see is merely a asterisk sign.Following code explains it better.
int k =5
do
{ character=getch(); /* These thing is done so that password is not visible*/
gotoxy(k,8) ;printf("*");
str8[i]=character;
k++;
i++;
}while(character != '.');
i--;
str8[i]='\0';
This will keep on entering a string to that array str8[] and will not display the original characters entered but instead of that will display a "*" till users presses a dot.
Instead of dot u can use any sentinel value as if ASCII charater of return key is 13.
]




thanks
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC