Excuse generator - deprecated conversation help!

Hey guys! I’m new to the arduino and working with my lcd, so bear with me!
I’m trying to get the excuse generator to work in my code, and I keep getting this error message:

/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:40:92: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
char start []= {"I’m sorry but ","Don’t blame me ", "Not my fault ","Guess what happened "};
^
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:40:92: warning: deprecated conversion from string constant to 'char
’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:40:92: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:40:92: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:41:81: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
char middle []= {"Godzilla ","Chuck Norris ", "Scrooge McDuck ",“Soap McTavish”};
^
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:41:81: warning: deprecated conversion from string constant to 'char
’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:41:81: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:41:81: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:42:90: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
char ends []= {"tried to kill me. ",“ate my homework.”,“came after me.”,“stole my head.”};
^
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:42:90: warning: deprecated conversion from string constant to 'char
’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:42:90: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/Users/KaraBucaro/Documents/Arduino/excuse_generator/excuse_generator.ino:42:90: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
Multiple libraries were found for “LiquidCrystal.h”
Used: /Users/KaraBucaro/Documents/Arduino/libraries/LiquidCrystal
Not used: /Users/KaraBucaro/Downloads/Arduino.app/Contents/Java/libraries/LiquidCrystal

Sketch uses 3,132 bytes (9%) of program storage space. Maximum is 32,256 bytes.
Global variables use 281 bytes (13%) of dynamic memory, leaving 1,767 bytes for local variables. Maximum is 2,048 bytes.

Any ideas of what I can try and do? I’m using a mac, osx latest software, arduino uno.

This is what my set-up looks like, and attaching the code.

Thank you guys!!

excuse_generator.ino (2.6 KB)

The best thing to do with that warning is to ignore it. If you really must make it go away then you have to define all those string constants in char arrays and not in the function calls

Serial.print("Hello");

Becomes

char* theString = "Hello";
Serial.print(theString);

But that's an awful lot of work over a warning. I would just ignore it.

Try:

const char *start []= {"I'm sorry but ","Don't blame me ", "Not my fault ","Guess what happened "};

But that's an awful lot of work over a warning. I would just ignore it.

Or handle them correctly:

   Serial.print((char *)"Hello");

The const char * ("Hello") can be cast to a char *, which is what the Serial.print() function expects.

Better still, leave them in flash memory, where they belong

PaulS:
Or handle them correctly:

   Serial.print((char *)"Hello");

The const char * (“Hello”) can be cast to a char *, which is what the Serial.print() function expects.

Thank for for the help, I got it figured out and uploaded successfully! Now my only problem is the LED is not turning on, and I have a bar of black boxes.

karapb:
Hey guys! I'm new to the arduino and working with my lcd, so bear with me!
I'm trying to get the excuse generator to work in my code, and I keep getting this error message:

The only one talking about "error" and "error message", IS YOU!

The compiler just tells about "warning":

warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

A warning is NOT an error!

Get yourself informed about the deifference between a "warning" and an "error" in compiling C/C++ code!

A warning does NOT stop the compiler run and continues compiling the code. The cause of a warning might be a smaller coding problem and the compiler tries to guess what you mean and contnues compiling. In your case you are using an old 'deprecated' syntax, that was fully correct with older compiler versions, but creates warning with new compiler versions. After a warning (even many warnings) the compiler tries to recover the problem and continues compiling. Contrary, an 'error' stops the compiler run immediately with an anrecoverable error and does NOT try to continue.