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);
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:
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
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
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).