Call to Speakjet Library

Hello to you all, i am using the Speakjet chip a lot and got very good results with it,
prorgamming nice things witch sounds very nice,
Now trying to interface to the Speakjet library,
(Ps not included here, and needed in the sketch)
Over the serial in, so type some in the arduino serial terminal and
let it be read by the chip, so i have to send it “to the library”
and the library takes care of communication with the Speakjet.
But the lib call to speakjet.speakWord expects a const char*
And i give it a string&, so it will not work.
Is this possible, converting a string& to a const char*, maybe this is impossible
because this most be a const char*, and constant meens fixed so i can not change it
and thats just what i want to do, give it new words in over the serial line.
Or is there a work around the make this variable cal to the library
Or acces the library in another way to read from it via the serial line.
And how can one set up a library, that can be acceced over the serialline.
So make a sentence in the arduino serial terminal, hit enter, call the library,
let the library do it’s thing, let’s say it will communicate with a chip.
Thanks in advance, Dian from the Netherlands

/*
  Serial Event example

 When new serial data arrives, this sketch adds it to a String.
 When a newline is received, the loop prints the string and
 clears it.

 Created 9 May 2011
 by Tom Igoe

 This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/SerialEvent

 */

String inputString = "";         // a string to hold incoming data
boolean stringComplete = false;  // whether the string is complete
#include <SpeakJet.h>
#include <SoftwareSerial.h>

SpeakJet speakjet; // Defaults to txPin = 2, resetPin = 3, readyPin = 4, inverseLogic=false
void setup() {
  // initialize serial:
  Serial.begin(9600);
  if (!speakjet.init())
    Serial.println("SpeakJet init failed");
// reserve 200 bytes for the inputString:
  inputString.reserve(200);
    if (!speakjet.init())
    Serial.println("SpeakJet init failed");
}

void loop() {
  // print the string when a newline arrives:
   if (!speakjet.isReady())
    Serial.println("SpeakJet is not ready");
   if (stringComplete) {
    Serial.println(inputString);
     speakjet.speakWord( inputString);
    // clear the string:
    inputString = "";
    stringComplete = false;
  }
}

/*
  SerialEvent occurs whenever a new data comes in the
 hardware serial RX.  This routine is run between each
 time loop() runs, so using delay inside loop can delay
 response.  Multiple bytes of data may be available.
 */
void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the inputString:
    inputString += inChar;
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inChar == '\n') {
      stringComplete = true;
    speakjet.speakWord("afternoon");
  }
  }
}

And i give it a string&, so it will not work.

No, you don't. You give it a String.

Since you know how big the string that the String wraps is going to be, there is no excuse for using a String. So, stop that crap.

Learn to use NULL terminated arrays of chars, AKA strings, instead.

Doing arduino coding for a long time, and trying to learn something, i still have a question
What is the difference between a String and a string,
And what i fully seem to understand is that using it is no good so i should not use it
But i get some letter, or words from the serial and want to use them with the Speakjet library
Can one help me one the way,
How do i make a const char* from input from the arduino serial terminal
Thanks again

i still have a question
What is the difference between a String and a string,

You could search for an answer to that. A String is a class. A string is a NULL terminated array of chars.

And what i fully seem to understand is that using it is no good so i should not use it

But you used it anyway...

But i get some letter, or words from the serial and want to use them with the Speakjet library

The serial port sends/receives bytes, which we often interpret as characters, which are easy to store in an array. Look at Robin2's hard work:

Hello, still looking for an answer to the question if this is possible,
if converted can the Speakjet library do the thing it has to do,
Thanks in advance

Hello
And what i fully seem to understand is that using it is no good so i should not use it
"But you used it anyway..."
Sure i use the things i like and think are good or working and then looking for things to learn.
But i did not use it anyway, i did not know, till someone told me anyway.
Thanks for pointing me in the good direction, Robin2 work seems fine and interests me.
Dian from the Netherlands