Opened 16 years ago

Closed 15 years ago

#20 deleted Support Requests (None)

passwords in c++ programming

Reported by: nobody Owned by: nobody
Milestone: Component: None
Version: None Severity:
Keywords: Cc:


How would i hide the passwords by using (*** , i.e. 
asteriks signs ) in  c++ programming.

Attachments (1)

password.doc (23.5 KB) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 15 years ago by mohaps

Logged In: YES 

 this code works on windows 


#include <stdio.h>

int GETCH(void)
	return _getch();

int main(void)
char input;
char *ptr;
char password[20];
int count;

count = 0;

printf("enter your password: ");


input = GETCH();
if(input == '\xD') break; // enter pressed?
putc('*', stdout);
ptr = &input;
password[count] = *ptr;

}while(count < 20);

password[count++] = '\0'; // terminate the string 

printf("\nyour password: %s\n", password);

return 0;

comment:2 Changed 15 years ago by david_abrahams

Status: assignedclosed
Logged In: YES 

This is not an appropriate request for Boost.

Changed 11 years ago by anonymous

Attachment: password.doc added

Modify Ticket

Change Properties
Set your email in Preferences
as deleted The owner will remain nobody.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.