Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » A Couple of Quickies (C++)
Closed Thread
Old 02-23-2005, 06:02 PM   #1 (permalink)
 
Newb Techie

Join Date: Jan 2005

Posts: 8

JerryTyrrell290

Question A Couple of Quickies (C++)

So Im trying to write this thing. I have a few lines of code that look like this:

Code:
     char a [30];                                   // User Input (password)
     char b [30] = "password";                      // Actual password
     cout << "Enter Password to close program: ";
     cin.getline (closea,30);                       // Gets User Input (password)
     if (strcmp (closea,closeb) == 0)               // Compares the two strings
     {
          etc...                                    // Does the stuff
     }
"b" is supposed to be a password, currently set to password. I was wondering if anyone knows a way to get tha characters to show up as "*" when they are typed instead of letters? Its not necessary, but it would be nice to have it that way, for secrecy purposes.

________________________________________________
________________________________________________
________________________________________________


I have another quickie. Is there any way to get a program to send an e-mail. Any insite into this subject would be greatly appreciated.
JerryTyrrell290 is offline  
Old 02-23-2005, 06:49 PM   #2 (permalink)
 
Monster Techie

Join Date: Sep 2004

Posts: 1,447

Alex81388

Send a message via AIM to Alex81388
Default

First of all, what do you mean by an e-main? Am i completely missing the termanology or what?


The best chance you have to display the * is to quickly move over the curser to the last position while saving the last digit typed, and replacing that last digit with an *.

Thats the best I can think of, unless you plan on reading each char seperatly?
__________________
Sig removed due to foul language. Please read the rules regarding the allowable content of sigs before reposting your COMPLIANT sig.
~Trotter
4/21/06
Alex81388 is offline  
Old 02-23-2005, 07:19 PM   #3 (permalink)
 
Newb Techie

Join Date: Jan 2005

Posts: 8

JerryTyrrell290

Default

Sorry, I meant to say "e-mail"

and how would I go about doing the thing where I read each char seperately? Could you give me a quick example? Thanks
JerryTyrrell290 is offline  
 
Closed Thread

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
Trackbacks are On
Pingbacks are On
Refbacks are On