strings, serialport and concatenation.

hey im hoping someone might be able to lend a hand. right now im learning about strings and how to combine strings and using them in serial ports. I was able to get hello Nicholas and its my program to print in the serial port but now im trying to combine both serials together onto one print line. ive checked my coding and can see anything wrong with it but now it wont print the hello Nicholas its my program. maybe you can help.

int redLedPin=9; //Declaring red led as an int, and set to 9:
int yellowLedPin=10; // Declaring yellow led as an int, and set to 10:
int redOnTime=250; //Red led is on 250:
int redOffTime=250; // Red led is off 250:
int yellowOnTime=250; // Yellow led is on 250:
int yellowOffTime=250; // Yellow led is off 250:
int numRedBlink=5;
int numYellowBlink=3;
String redMessage= "the red led is blinking"; // declaring a string variable
String yellowMessage= "the yellow led is blinking"; // declaring a string variable

void setup() {
Serial.begin(9600);
String wm1 ="hello nicholas"; // declare string variable
String wm2="its your program";
String wm3; // declare a sting variable
wm3=wm1+wm2; // assign wm1 plus wm2 or otherwise known as concatenation
Serial.print(wm3);
pinMode(redLedPin,OUTPUT);
pinMode(yellowLedPin,OUTPUT);

}

void loop() {
int c=c+1;
Serial.println(redMessage);
for (c=1; c<=numRedBlink; c=c+1){ // starting for loop
Serial.print("I am Awsome");
Serial.println(c);
digitalWrite(redLedPin,HIGH); // turn the red led on:
delay(redOffTime); // wait:
digitalWrite(redLedPin,LOW); // turn the red led off:
delay(redOffTime); //Wait:
}
Serial.println(" ");
Serial.println(yellowMessage);
for (int c=1; c<=numYellowBlink; c=c+1){
Serial.print("i am awsome");
Serial.println(c);
digitalWrite(yellowLedPin,HIGH); //turn the yellow led on:
delay(yellowOffTime); //Wait:
digitalWrite(yellowLedPin,LOW); //turn the yellow led off:
delay(yellowOffTime); //Wait:
Serial.println(" ");
}
}

Serial.print(string1);
Serial.println(string2);

...R

What is it doing instead of what you expect? When asking for help, you should always tell us what it does instead. I don't use String much (for reasons outlined below), but I'm not sure why that's not working as written.

Also - Strings (with a capitol S) are a bad thing in general - something to avoid when you can - because they use dynamic memory allocation. Every time you concatenate, it has to find a new block of memory to put the concatenated string in. This can result in the ram becoming fragmented, causing you to run out of ram before you otherwise would.

When possible, use normal strings, that is, fixed length character arrays. These are harder to concatenate and otherwise manipulate (see strcat and the other c string functions), but they don't use dynamic memory allocation - so, among other things, you see how much memory your global and static char arrays are using when you compile the sketch.

Because of this, wheras in many languages, it would be considered better practice to concatenate all the stuff you're printing and then send that to Serial.print(), in Arduino, the opposite is often true.