I'm trying to make so it would check if letter i and i+1 are alike. If so it'd drop "denied" else "accepted". i dont understand what I did wrong though:
#include <iostream>
using namespace std;
int main()
{
char pass[5];
bool correct=false;
cout<< "pass: "; cin>> pass;
for (int i=0; i<5; i++)
{
if (pass[i] != pass[i+1])
correct=true;
}
if (correct==false) cout<< "denied";
else cout<< "accepted";
return 0;
}