Store Keypas Pass in char* variable

Hello Guys,

I'm new to arduino and i'm looking to do a function to store or append the pressed keys on a keypad inside a char variable.. is this possible?

Here's what i'm doing:

void newPassJVC(KeypadEvent eKey){

  char *newKey;


  switch (keypad.getState()){
  case PRESSED:
    lcd.clear();
    lcd.setCursor(0,1);
    lcd.print(eKey);

    switch (eKey){
    case '*': 
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print(newKey);
      jvc.set(newKey);
      break;
    case '#': 

      lcd.clear();
      lcd.print("Cancelar...");

      delay(1000); 
      currentPosition = -1;      
      displayCodeEntryScreen();


      break;
    default: 
      newKey += eKey;


    }
  }
}

It clearly isn't working..

Thanks in advance!

Regards,

Jesus

It clearly isn't working..

Of course not. newKey is a pointer. What does it point to? You haven't made it point to anywhere where you can store data.

      newKey += eKey;

Incrementing a pointer that points nowhere doesn't make sense.

Before you start trying to use pointers to do this, work on storing data in a char array, first.