GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Jul-2004, 17:54
nkhambal nkhambal is offline
Regular Member
 
Join Date: Jul 2004
Location: CA USA
Posts: 313
nkhambal is a jewel in the roughnkhambal is a jewel in the rough

How to hide characters from being displayed on screen as they are keyed in?


Hi,

In C programming,how can you hide the characters from being displayed on screen while they are being keyed in?For e.g Keying in passwords.

Thanks,
  #2  
Old 28-Jul-2004, 23:05
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,245
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by nkhambal
Hi,

In C programming,how can you hide the characters from being displayed on screen while they are being keyed in?For e.g Keying in passwords.

Thanks,
In Standard C, no. But a couple compilers have given the developer a way to do it. What compiler are you using and on what OS?
__________________

Age is unimportant -- except in cheese
  #3  
Old 28-Jul-2004, 23:09
nkhambal nkhambal is offline
Regular Member
 
Join Date: Jul 2004
Location: CA USA
Posts: 313
nkhambal is a jewel in the roughnkhambal is a jewel in the rough
Hello waltp,

I use GNU C complier (gcc) on linux.

Thanks,
  #4  
Old 29-Jul-2004, 03:45
nkhambal nkhambal is offline
Regular Member
 
Join Date: Jul 2004
Location: CA USA
Posts: 313
nkhambal is a jewel in the roughnkhambal is a jewel in the rough
Hi Waltp,

I got a solution for my problem.I used getpass() function on linux platform as mentioned below.

CPP / C++ / C Code:
#define PASSPROMPT "Password: "

char *pass;

pass=getpass(PASSPROMPT);


It stores password in pass and does not display anything on screen.

Thanks,
  #5  
Old 06-Aug-2004, 11:18
dabigmooish's Avatar
dabigmooish dabigmooish is offline
Member
 
Join Date: May 2004
Location: Baltimore (middle of Canton)
Posts: 165
dabigmooish will become famous soon enough
As a cheap method you could probally "jury-rig" it with a system clear command after every key is typed.
__________________
"To argue with a person who has renounced the use of reason is like administering medicine to the dead."
-Thomas Paine
www.sullivan-county.com/deism.htm
  #6  
Old 06-Aug-2004, 19:43
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,245
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
EDIT by dsmith
The preceeding post was split as a seperate thread to the C++ Tutorials forum. Please click here to go to this thread.
END EDIT



Quote:
Originally Posted by davekw7x
Here is a routine that I picked up somewhere some time ago (sorry, I didn't record the source, but I am quite sure I didn't delete any copyright notice). If it turns out that it is copyrighted or patented or something: let me know.

I'm sure it's not copyrighted not proprietary. It's a standard way to implement getch() on *nix. When I was on a Unix system, I remember digging around and made an almost identical function.

Moderators:
This code would be a great addition to the tutorial section... hint, hint

;-)
__________________

Age is unimportant -- except in cheese
Last edited by dsmith : 10-Aug-2004 at 12:24. Reason: Split out post for a tutorial entry
  #7  
Old 09-Aug-2004, 04:04
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
This is handy. Good idea WaltP, thread moved.
GF
  #8  
Old 09-Aug-2004, 19:01
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,245
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by Garth Farley
This is handy. Good idea WaltP, thread moved.
GF
I was kinda hoping the important post would move, not the entire thread... ;-)
__________________

Age is unimportant -- except in cheese
  #9  
Old 10-Aug-2004, 09:22
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
And that's my fault, I was discussing your comment with dsmith in private when it should have been discussed in the MODERATOR forums. Garth wasn't aware that dsmith was going to be 'handling' the thread. Dsmith will follow up on this as soon as he has the time... Once again, I apologise for delaying the 'splitting' of this thread.
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] How to hide e-mail address from SPAM Bots BobbyDouglas Web Design Forum 40 13-Feb-2006 09:44
nvidia fx5200 128mb black screen!! cpu-loser Computer Hardware Forum 32 21-Jul-2004 18:28
send pc image to tv screen?! Hood Computer Hardware Forum 5 05-May-2004 11:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 05:35.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.