Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 2nd, 2005, 9:35 PM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
masked input in c++

how can you make it so that in c++ when the user inputs stuff through cin it comes up as * instead of the actual text theyre typing? im trying to make a password thing.
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
Old Sep 2nd, 2005, 10:24 PM   #2
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
oh im sorry never mind. somebody delete this thread.
__________________
Children in the dark cause accidents, and accidents in the dark cause children.

http://www.ronincoders.org
Intimidat0r is offline   Reply With Quote
Old Sep 3rd, 2005, 6:57 AM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Well, did you figure it out?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 3rd, 2005, 9:01 AM   #4
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
I'm pretty sure you can delete your own threads, if you've been the only one to post thus far (which you were).
Riddle is offline   Reply With Quote
Old Sep 3rd, 2005, 10:16 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Yeah, but you only get half an hour.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 3rd, 2005, 12:58 PM   #6
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4 Brent is on a distinguished road
...but how do you mask input text?
Brent is offline   Reply With Quote
Old Sep 3rd, 2005, 1:38 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You'd have to use the getch() function. What compiler and what OS are you using? It's different for each one.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 3rd, 2005, 5:35 PM   #8
Brent
Highly Adaptive Penguin
 
Brent's Avatar
 
Join Date: May 2005
Location: United States
Posts: 251
Rep Power: 4 Brent is on a distinguished road
i have a digital mars compiler on windows. how would i use getch to do this, could you give em an example?
Brent is offline   Reply With Quote
Old Sep 3rd, 2005, 7:20 PM   #9
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
First off, you have to include conio.h if you're using C, or cconio if you're using C++:
#include <cconio>
Then you can call the getch() function. It returns a character as soon as it is typed, and doesn't echo it to the screen. It's sister function, getche(), does. If you're using C++, they're in the std namespace. I think.
char c;
c = std::getch();
printf("*");
Note that any buffering and backspace-handling is left entirely up to the programmer when using this function. Oh, and by the way, using conio.h/cconio renders your program unportable.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 3rd, 2005, 8:18 PM   #10
2roll4life7
Programmer
 
2roll4life7's Avatar
 
Join Date: Aug 2005
Location: 0x0010 * 0x0091 + 0x0004
Posts: 65
Rep Power: 4 2roll4life7 is on a distinguished road
I've seen portable ways of doing this in C and Java. I know there is one posted on the java.sun.com forums somewhere, sorry I don't have the link. And also, the prototype of this function is declared as returning an int.
__________________
#if 0 /* in case someone actually tries to compile this */
- libpng version 1.2.8 (example.c)

<Jim_McNeat> Is there like a way to put a compiler in "Just trust me on that one" mode?
2roll4life7 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:13 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC