Opened 21 years ago
Closed 19 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: |
Description
How would i hide the passwords by using (*** , i.e. asteriks signs ) in c++ programming.
Attachments (1)
Change History (3)
comment:1 by , 20 years ago
comment:2 by , 19 years ago
| Status: | assigned → closed |
|---|
Logged In: YES user_id=52572 This is not an appropriate request for Boost.
by , 15 years ago
| Attachment: | password.doc added |
|---|
Note:
See TracTickets
for help on using tickets.

Logged In: YES user_id=110222 Hi, this code works on windows mohaps #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: "); do { input = GETCH(); if(input == '\xD') break; // enter pressed? putc('*', stdout); ptr = &input; password[count] = *ptr; count++; }while(count < 20); password[count++] = '\0'; // terminate the string printf("\nyour password: %s\n", password); return 0; }