So i treid to make a passward reader

the correct passward is idk1234567

but even if i put a wrong passward or the correct password is happening the same thing ,i should put a nother value

when i inset de correct password it should display "Loading..."(this is never happening)

#include
using namespace std;
char a[20];
int main()
{

cin>>a[10];
while(a[10]!='idk1234567'){
cin>>a[10];

}
{
cout<<"\n"<<"Loading..."<<"\n";
for(int i=1;i<=40;i++){
timer(b);
cout<<"I";
}
}

return 0;
}

Răspuns :

#include <iostream>

#include <cstring>

using namespace std;

int main()

{

   char s[20];

   cin.get(s,19);

   while( strcmp(s,"idk1234567") != 0)

   {

       cout<<"Wrong password! Try again!"<<endl;

       cin.get();

       cin.get(s,19);

   }

   cout<<"Loading...";

}

I did not put what is after "for" so ... this code should work until you type the correct password. Good luck!