+ 2

The password field for c++

answer

28th May 2017, 3:28 PM
Michael
Michael - avatar
2 odpowiedzi
+ 4
// copy this code should i explain you. #include <iostream> #include<cstdlib> #include<cstring> #include<conio.h> int main() { std::string a=""; std::string b="ABCD"; char c; for(int i=0;i<1000;i++) { c=getch(); if(c=='\r') break; std::cout<<"*"; a+=c; } if(a==b) std::cout<<"Password Matched!!!"; else std::cout<<"Password Incorrect!!!"; return 0; }  
28th May 2017, 4:33 PM
MR Programmer
MR Programmer - avatar
+ 2
thanks
28th May 2017, 4:35 PM
Michael
Michael - avatar