+ 2
The password field for c++
answer
2 Answers
+ 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; }
Â
+ 2
thanks