| | |
Input a "password" string
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
•
•
Originally Posted by hail2dthief
No, that's not what i'm talking about. What I want is when I enter a string, the asterisks will come out on the screen. Just like when you enter your password to log in to this website.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
C++ Syntax (Toggle Plain Text)
//Warning,written by hand.Mistakes are possible void pass(char *s,int len,char mask='*') { int loc = 0; char p; int x = getx(); int y = gety(); do { p = getch(); if(p == '\r') // \r = enter { s[loc] = 0; break; } else if(p == '\b') // \b means backspace { if(loc>0) { s[loc]=0; loc-- gotoxy(x-1,y); cout<<" "; gotoxy(--x,y); } } else { s[loc++] = p; x++; cout<<m; } } while(true); }
![]() |
Similar Threads
- how can you input a string, clear the screen, then print Hello "string" (Assembly)
- Help me in username and password validation through accessing the database (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: merged:nesting loops
- Next Thread: *Pointer program problem.
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int java lib library lines linkedlist linker loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return sort string strings struct studio system temperature template templates test text text-file tree unix url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






