String to char[16]?

Im using Wstring lib.
i created a string and a char like so:

String inString = String(16);       // The string created by the user pressing keys
char Password[16] = ("123ABC");     // The default password

I type in the key pad and add to the string like so:

      case '1':
      case '2':
      case '3':
      case '4':

i can compare to see if the user typed the correct password like so:

 if (inString.equals(Password)) {

All things above work good. I basically used the sample code with the lib.
Sample code below

#include <WString.h>                // include the String library

#define maxLength 30

String inString = String(maxLength);       // allocate a new String
boolean answerComplete = false;

void setup() {
  // open the serial port:
  // Say hello:
  Serial.print("String Library version: ");
  // print the question:

void loop () {
  // get anything the user typed:
  if(Serial.available() > 0) {
  // if they've finished answering, check the answer:
  if (answerComplete == true) {
    if (inString.equals("monkey")) {
      Serial.println("That's right, and don't you say otherwise.");
      answerComplete = true;
    // if they got it wrong, tell them:
    else {
      Serial.println("Wrong. Loser."); 
    // clear the string and ask again:
    inString = "";


void askQuestion() {
  Serial.print("What's the coolest animal?"); 
  answerComplete = false;

void getIncomingChars() {
  // read the incoming data as a char:
  char inChar =;
  // if it's a newline or return, print the string:
  if ((inChar == '\n') || (inChar == '\r')) {
    answerComplete = true;
  else {
    // if you're not at the end of the string, append
    // the incoming character:
    if (inString.length() < maxLength) {
    else {
      // empty the string by setting it equal to the inoming char:
      inString = inChar;

Only difference is im not reading data so i can’t put it into a char 1st, i think…

The Problem****

So i’m trying to change my password. Code below errors and says i cant go from string to char[16].

case 1:
         Password = inString;
         mySerial.print("?fNEW PASSWORD SET");

ive tried many variatioons here. I can convert inString to an INT by using atoi(). just didn’t see anything on string to char. So similar yet so different…

Also if i change Password to a String then this part of the code works but the compare password(inString.equals(Password)) part of the code errors.

Help pls


use the function getChars() to copy the characters from String to char array.