user19606: I am using a flame sensor. I am reading the state and then printing it. Here is my code: 
void loop(){
 flameState = digitalRead(flamePin);//variables already defined and are global
existsFire();//calls the void
delay(1000);
}

void existsFire(){

Serial.println("Flame: " + flameState);

}

Before, this printed out the right thing. Today, it was printing out "lame:". The "F" and the flameState were missing. I changed it to:
void existsFire(){

Serial.print("Flame: ");
Serial.println(flameState);

}

Everything worked fine. Is there a problem with my Arduino Mega. What do I need to do to fix this?

user22924: You've stumbled across the difference in the C++ language between a String and an "array of characters". What you gave Serial.println() was an array of characters:
Serial.println("Flame: "...);

and then tried to add a number to it.
Serial.println("Flame: " + flameState);

If it had have been a String, then what you typed would have been fine:
String flame = "Flame: ";
Serial.println(flame + flameState);

Adding (literally +) a number to a String adds characters to the String to represent the number. Unfortunately you didn't start with a String, you started with an array of characters:
"Flame: "

Adding a number to THAT changes where the array starts. flameState must have been 1, and "Flame: " + 1 would have been "lame :" - as you found out!
The version that worked did so through a little bit of magic:
Serial.print("Flame: ");
Serial.println(flameState);

The first line called a version of print() that accepted an array of characters and printed each of them out. The second line called a different version of println() that accepted a number and printed out its representation as a series of characters (digits) - followed by a new line (the ln part of the name).

19606: <p>I am using a flame sensor. I am reading the state and then printing it. Here is my code: </p>

<pre><code>void loop(){
 flameState = digitalRead(flamePin);//variables already defined and are global
existsFire();//calls the void
delay(1000);
}

void existsFire(){

Serial.println("Flame: " + flameState);

}
</code></pre>

<p>Before, this printed out the right thing. Today, it was printing out "lame:". The "F" and the flameState were missing. I changed it to:</p>

<pre><code>void existsFire(){

Serial.print("Flame: ");
Serial.println(flameState);

}
</code></pre>

<p>Everything worked fine. Is there a problem with my Arduino Mega. What do I need to do to fix this?</p>
 22924: <p>You've stumbled across the difference in the C++ language between a <code>String</code> and an "array of characters". What you gave <code>Serial.println()</code> was an array of characters:</p>

<pre><code>Serial.println("Flame: "...);
</code></pre>

<p>and then tried to add a number to it.</p>

<pre><code>Serial.println("Flame: " + flameState);
</code></pre>

<p>If it had have been a <code>String</code>, then what you typed would have been fine:</p>

<pre><code>String flame = "Flame: ";
Serial.println(flame + flameState);
</code></pre>

<p>Adding (literally <code>+</code>) a number to a <code>String</code> adds characters to the <code>String</code> to represent the number. Unfortunately you didn't start with a <code>String</code>, you started with an array of characters:</p>

<pre><code>"Flame: "
</code></pre>

<p>Adding a number to THAT changes where the array starts. <code>flameState</code> must have been <code>1</code>, and <code>"Flame: " + 1</code> would have been <code>"lame :"</code> - as you found out!</p>

<p>The version that worked did so through a little bit of magic:</p>

<pre><code>Serial.print("Flame: ");
Serial.println(flameState);
</code></pre>

<p>The first line called a version of <code>print()</code> that accepted an array of characters and printed each of them out. The second line called a <em>different</em> version of <code>println()</code> that accepted a number and printed out its representation as a series of characters (digits) - followed by a new line (the <code>ln</code> part of the name).</p>
