user18804: I am making an Arduino alarm. This is the error:
exit status 1
invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'

Here is the code that triggers it: 
lcd.print("0"+hours+":"+minutes);

This code is similar, but worked before:
String none="00";
lcd.print(none+":"+none+":"+minutes);

I can post the full code if you need it. How can this be fixed?

user22924: Your first code took a String object, then added other strings (note lowercase) to it - which are characters enclosed in quotes. It is legal to add strings to String objects.
Your new code doesn't have any String objects at all - and you're not allowed to add strings to strings (both lowercase).
It will work if you change your new code to:
lcd.print(String("0")+hours+":"+minutes);
That turns the original string "0" into a String object, and then adds more strings to it.

18804: <p>I am making an Arduino alarm. This is the error:</p>

<pre><code>exit status 1
invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
</code></pre>

<p>Here is the code that triggers it: </p>

<pre><code>lcd.print("0"+hours+":"+minutes);
</code></pre>

<p>This code is similar, but worked before:</p>

<pre><code>String none="00";
lcd.print(none+":"+none+":"+minutes);
</code></pre>

<p>I can post the full code if you need it. How can this be fixed?</p>
 22924: <p>Your first code took a <code>String</code> object, then added other strings (note lowercase) to it - which are characters enclosed in quotes. It is legal to add strings to <code>String</code> objects.</p>

<p>Your new code doesn't have any <code>String</code> objects at all - and you're not allowed to add strings to strings (both lowercase).</p>

<p>It will work if you change your new code to:</p>

<p><code>lcd.print(String("0")+hours+":"+minutes);</code></p>

<p>That turns the original string <code>"0"</code> into a <code>String</code> object, and then adds more strings to it.</p>
