Keypad & Password Library - Problem with password.set

I'm working on making a keypad with a password, and I want to be able to change the password using the "password.set" function, but whenever I pass the String that contains the password, as follows:

password.set(newPassword);

It errors: No matching function for call to 'Password::set(String&)'

However, if I replace it with this, it works fine: password.set("4321");

Heres some snippets from my code:

// Defines the new String at the beginning of the code.
String newPassword; 

// Detects the key that is pressed and appends it to the String.
newPassword = newPassword + eKey; 

// Set the password after the * has been pressed.
password.set(newPassword);

Here more details on the project i'm doing: http://bildr.org/2011/05/arduino-keypad/

The problem is that even though String contains text, just like "4321", they are different objects internally, and the Password::set function doesn't know how to use a String. One option is to move the String into a char buffer and use that:

char buff[16]="";
newPassword.toCharArray(buff,sizeof(buff));
password.set(buff);

However, you need to make sure that buff is long enough for your longest password, plus one, or you'll lose characters in the process.

How is your .set defined? Can you post the method definition?

Were you able to solve this problem? I currently have the same and I have been trying to fix it for days and still I can not, I would be grateful for any help

The OP's last post was in June 2012, so I wonder if s/he is still monitoring the forum?

Gunfred: Were you able to solve this problem? I currently have the same and I have been trying to fix it for days and still I can not, I would be grateful for any help

Very similar posted here: https://forum.arduino.cc/index.php?topic=501669.msg4592701#msg4592701

Please do not cross-post. Stick to one thread.

And hijacking old threads is not always the best thing to do. I applaud you for doing research but you would have been better off starting your own thread (referencing old threads if applicable).