HELP KEYPAD 4X4+MEGA 1280 PASSWORD

I NEED HELP

#include <Keypad.h>
char cmd;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
int c=0;

char password[5]={'3','1','3','1',''};
boolean password_flag=false;
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1','2','3','a'},
{'4','5','6','b'},
{'7','8','9','c'},
{'
','0','#','d'}
};
byte rowPins[ROWS] = { 24,25,22,23}; //connect to the row pinouts of the keypad
byte colPins[COLS] = { 28,29,26,27 }; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad cusomKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
char customKey = cusomKeypad.getKey();
void setup(){

Serial.begin(9600);
cmd=Serial.read();
char customKey = cusomKeypad.getKey();
Serial.print("enter 2\n");
Serial.print(customKey);

}
void loop(){
char customKey = cusomKeypad.getKey();
if (customKey != NO_KEY){
if (customKey=='2')
{{
Serial.print("enter pass\n");{
for(int i=0;i<5;i++)
{
if(customKey== password*)*
_ if(cmd==password*)_
_
c++;*_

* }*
* if(c==5)*
* password_flag=true;
if( password_flag==true)*

* Serial.print("all good\n");*
* }}}*
* else*
* {*

* Serial.print("eror");*
* }*
}}[/quote]
It does not refer to the following code segment

> for(int i=0;i<5;i++)
> {
> if(customKey== password*)*
> _ if(cmd==password*)_
> _ c++;_
_
>_
> _ }_
> _ if(c==5)_
> password_flag=true;
> if( password_flag==true)
_
>_
> _ Serial.print("all good\n");_
> _ }}}[/quote]*_

> ITS JUMP TO THE ELSE

I'm amazed that even compiles.

Serial.print("enter pass\n");{

Shouldn't have the "{" at the end (also remove the corresponding "}")

I don't have an Arduino or IDE handy, so this may still be Full Of Bugs. Please note the questions, I think you need to look at your logic. Step through it manually line by line, because I'm fairly sure you'll never get this loop working like you want it to:

void loop() {
  char customKey = cusomKeypad.getKey();
  if (customKey != NO_KEY) {
    if (customKey=='2') {  // What is this IF for? All it seems to do is to exclude any character that isn't "2", so your password will  never be matched.

      Serial.print("enter pass\n");

      for(int i=0;i<5;i++)
        if(customKey == password) // Shouldn't this be password[i]? And don't you need to use strCmp()?
          if(cmd==password)  // Why are you doing this line? You are comparing both the serial input AND the stored password; if the serial + stored don't match, this will always be false
            c++;

      //  You need to reset variable c to zero if a wrong character is found otherwise typing 123*123*123*123*123* would match your 3131* password.
                
                
      if(c==5)
        password_flag=true;

      if( password_flag==true)                    
        Serial.print("all good\n");
    } else {
      Serial.print("eror");
    }
  }
}

The OP's code doesn't compile.

            if(customKey== password)
              if(cmd==password)

sketch_apr11a:52: error: ISO C++ forbids comparison between pointer and integer
sketch_apr11a:53: error: ISO C++ forbids comparison between pointer and integer