String(int) function stopping the Arduino Well I am trying make an application with arduino leonardo and GSM Shield. There are conditions if, else if, else .. etc
  if (smsMetni.indexOf(&quot;DURUM&quot;) != -1) {
    Serial.println(&quot;SMS income&quot;);
    String temp= String(analogRead(LM35_pin) * 0.48828125);
    String temp2 = &quot;Hava &quot; + temp + &quot; derece.&quot;;
    char tempSMS2[] = &quot;&quot;;
    temp2.toCharArray(tempSMS2, 30);
    Serial.println(tempSMS2);
    Kapadokya.smsGonder(gonderilecekTelNumarasi, tempSMS2);
  }

After the last line &quot;Kapadokya.smsGonder(gonderilecekTelNumarasi, tempSMS2);&quot; program stopping I watching serial monitor there is no notification or error. just stopping.
If I change those lines and remove String(analogRead(LM35_pin) * 0.48828125) :
    String temp= String(analogRead(LM35_pin) * 0.48828125);
    String temp2 = &quot;Hava &quot; + temp + &quot; derece.&quot;;

and just write like this, it works very well.
String temp2 = &quot;Hava  derece.&quot;;

maybe you think there is a problem with LM35, even if I change it String(analogRead(LM35_pin) * 0.48828125); with String(30);, it doesn't work again. after the last line it is not continue.
only one sollution I've found if add delay(500) after each line it works but my codes looks ugly with this. are there any solution.
You should avoid String on the Arduino. It will cause random crashes. However that's not your issue. Your issue is trying to copy the data into an array that is too small.
char tempSMS2[] = &quot;&quot;;

That creates a one byte array which contains just a \0. You then try and squeeze your String data into it and it of course overflows all over the rest of your variables and data.
A better solution is to work directly in char arrays. It is a little trickier though:
First convert your float to a string:
char tempFloat[8];
dtostrf(analogRead(LM35_pin) * 0.48828125, -7, 3, tempFloat);

Then build up your string:
char tempSMS2[30];
strcpy_P(tempSMS2, PSTR(&quot;Hava &quot;));
strcat(tempSMS2, tempFloat);
strcat_P(tempSMS2, PSTR(&quot; derece.&quot;));