Can't assign String to Array of String I have to input 5 words and organize.
In order to organize words, I have to get them into Array of String to compare.
I succeed to get char[buffer] into String in_str but somehow in_str doesn't 
get into str[5].
is String str[i]=in_str;  Wrong?? How can I put in_str to Array of String str??

void setup() {
  Serial.begin(9600); }

void loop() {
  int state = 1, len = 0 ,i=0, k=1;
  char buffer[128];
  String str[5];
  while (true) {
    if (state == 1) {
      Serial.print("Enter the ");
      Serial.print(k);
      Serial.print("th Word --&gt; ");
      state = 2;
    } 
    while (Serial.available()) { 
      char data = Serial.read();
      if (data == '\n') {  
        buffer[len] = '\0';
        String in_str = buffer;
        String str[i]=in_str;
        Serial.println(in_str); 


        i=i+1;
        k=k+1;
        len = 0;
        if(i&gt;4){state = 3; }
        else {state = 1;} 
        break;
      }
      buffer[len++] = data;
    }
  if(state==3){
    Serial.println("After Sorting");
   for (int i = 0; i &lt; 4; i++) {
    for (int j = i + 1; j &lt; 5; j++) {
      int compare = str[i].compareTo(str[j]);
      if (compare &gt; 0) {         String temp = str[i];
        str[i] = str[j];
        str[j] = temp;
      }
    }
  }

   for (int i = 0; i &lt; 5; i++) {
    Serial.println(String(i) + " : " + str[i]);
  }


    break;  
  }

  }
}
When you write String str[i]=in_str; that is wrong. You only write the type when you are declaring the variable, once. 

When assigning, you need only write the variable name, not the type: str[i]=in_str;