user13344: I have a global array. I'd like to update the array while the program running.
But, I've found that my program below doesn't work as I expected.
Please checkout the program source:
#define RespLength 10
char* response[] = {"0","0","0","0","0","0","0","0","0","0"};
int idxUpd  = 0;

void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Start");
}

void loop() {
  // put your main code here, to run repeatedly:
    char assign[5];
    int wkt = random(10, 99);
    dtostrf(wkt, 4, 1, assign);

    response[idxUpd]  = assign;

    Serial.print("Iteration "+String(idxUpd)+" : ");
    for (int i=0;i<RespLength;i++){
        Serial.print(response[i]);Serial.print(",");
    }
    Serial.println();
    delay(500);

    idxUpd++;
    idxUpd = idxUpd >= 10 ? 0 : idxUpd;
}

Expected output: please concern to the patern
Iteration 0 : 12.2,0,0,0,0,0,0,0,0,0,
Iteration 1 : 12.2,23.7,0,0,0,0,0,0,0,0,
Iteration 2 : 12.2,23.7,65.3,0,0,0,0,0,0,0,
Iteration 3 : 12.2,23.7,65.3,0,0,0,0,0,0,0,
Iteration 4 : 12.2,23.7,65.3,15.9,0,0,0,0,0,0,
Iteration 5 : 12.2,23.7,65.3,15.9,10.1,0,0,0,0,0,
Iteration 6 : 12.2,23.7,65.3,15.9,10.1,11.6,0,0,0,0,
Iteration 7 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,0,0,0,
Iteration 8 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,98.2,0,0,
Iteration 9 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,98.2,68.6,90.1,

Current output:
Iteration 0 : 85.0,0,0,0,0,0,0,0,0,0,
Iteration 1 : 28.0,28.0,0,0,0,0,0,0,0,0,
Iteration 2 : 36.0,36.0,36.0,0,0,0,0,0,0,0,
Iteration 3 : 70.0,70.0,70.0,70.0,0,0,0,0,0,0,
Iteration 4 : 56.0,56.0,56.0,56.0,56.0,0,0,0,0,0,
Iteration 5 : 74.0,74.0,74.0,74.0,74.0,74.0,0,0,0,0,
Iteration 6 : 94.0,94.0,94.0,94.0,94.0,94.0,94.0,0,0,0,
Iteration 7 : 94.0,94.0,94.0,94.0,94.0,94.0,94.0,94.0,0,0,
Iteration 8 : 26.0,26.0,26.0,26.0,26.0,26.0,26.0,26.0,26.0,0,
Iteration 9 : 71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,

From the result above, I can conclude that if I update the array value incrementally, it just overwrites the other element in the array.
So, How can I have my expected output?

user23644: C/C++ Arrays don't work the way you are used from scripting languages.
Your
char* response[] = {"0","0","0","0","0","0","0","0","0","0"};

allocates a consecutive space in memory with the lenght of 20 bytes.
So you have 10 pointers that point to static memory.
In your loop you have a array of char assign[5] that gets assigned to every single of those pointers with response[idxUpd]  = assign;. You copy pointers and not values here. So the only value you really have is that in your assign variable. So as you update the pointes of the array, you get the results you see.

user-1: You are using a char pointer (char*) instead of a char.
When you say;
response[idxUpd]  = assign;

you are assigning not the value but a pointer to that value. That points to assign for every element in response[]. Every response[] get the same pointer value, every response[] get the same value.
Use this:
#define RespLength 10
int response[] = {0,0,0,0,0,0,0,0,0,0};
int idxUpd  = 0;

void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Start");
}

void loop() {
  // put your main code here, to run repeatedly:
    int wkt = random(10, 99);
    response[idxUpd]  = wkt;

    Serial.print("Iteration "); Serial.print(idxUpd); Serial.print(" : ");
    for (int i=0;i<RespLength;i++){
        Serial.print(response[i] );Serial.print(",");
    }
    Serial.println();
    delay(500);

    idxUpd++;
    idxUpd = idxUpd >= 10 ? 0 : idxUpd;
}

I don't understand why you are converting a int to a float. That value doesn't change, so I omitted the dtostr() call.

13344: <p>I have a global array. I'd like to update the array while the program running.
But, I've found that my program below doesn't work as I expected.</p>

<p><strong>Please checkout the program source:</strong></p>

<pre><code>#define RespLength 10
char* response[] = {"0","0","0","0","0","0","0","0","0","0"};
int idxUpd  = 0;

void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Start");
}

void loop() {
  // put your main code here, to run repeatedly:
    char assign[5];
    int wkt = random(10, 99);
    dtostrf(wkt, 4, 1, assign);

    response[idxUpd]  = assign;

    Serial.print("Iteration "+String(idxUpd)+" : ");
    for (int i=0;i&lt;RespLength;i++){
        Serial.print(response[i]);Serial.print(",");
    }
    Serial.println();
    delay(500);

    idxUpd++;
    idxUpd = idxUpd &gt;= 10 ? 0 : idxUpd;
}
</code></pre>

<p><strong>Expected output:</strong> please concern to the patern</p>

<pre><code>Iteration 0 : 12.2,0,0,0,0,0,0,0,0,0,
Iteration 1 : 12.2,23.7,0,0,0,0,0,0,0,0,
Iteration 2 : 12.2,23.7,65.3,0,0,0,0,0,0,0,
Iteration 3 : 12.2,23.7,65.3,0,0,0,0,0,0,0,
Iteration 4 : 12.2,23.7,65.3,15.9,0,0,0,0,0,0,
Iteration 5 : 12.2,23.7,65.3,15.9,10.1,0,0,0,0,0,
Iteration 6 : 12.2,23.7,65.3,15.9,10.1,11.6,0,0,0,0,
Iteration 7 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,0,0,0,
Iteration 8 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,98.2,0,0,
Iteration 9 : 12.2,23.7,65.3,15.9,10.1,11.6,78.9,98.2,68.6,90.1,
</code></pre>

<p><strong>Current output:</strong></p>

<pre><code>Iteration 0 : 85.0,0,0,0,0,0,0,0,0,0,
Iteration 1 : 28.0,28.0,0,0,0,0,0,0,0,0,
Iteration 2 : 36.0,36.0,36.0,0,0,0,0,0,0,0,
Iteration 3 : 70.0,70.0,70.0,70.0,0,0,0,0,0,0,
Iteration 4 : 56.0,56.0,56.0,56.0,56.0,0,0,0,0,0,
Iteration 5 : 74.0,74.0,74.0,74.0,74.0,74.0,0,0,0,0,
Iteration 6 : 94.0,94.0,94.0,94.0,94.0,94.0,94.0,0,0,0,
Iteration 7 : 94.0,94.0,94.0,94.0,94.0,94.0,94.0,94.0,0,0,
Iteration 8 : 26.0,26.0,26.0,26.0,26.0,26.0,26.0,26.0,26.0,0,
Iteration 9 : 71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,71.0,
</code></pre>

<p>From the result above, I can conclude that if I update the array value incrementally, it just overwrites the other element in the array.<br>
So, How can I have my <code>expected output</code>?</p>
 23644: <p>C/C++ Arrays don't work the way you are used from scripting languages.
Your</p>

<pre><code>char* response[] = {"0","0","0","0","0","0","0","0","0","0"};
</code></pre>

<p>allocates a consecutive space in memory with the lenght of 20 bytes.
So you have 10 pointers that point to static memory.</p>

<p>In your loop you have a array of <code>char assign[5]</code> that gets assigned to every single of those pointers with <code>response[idxUpd]  = assign;</code>. You copy <strong>pointers</strong> and <strong>not values</strong> here. So the only value you really have is that in your <code>assign</code> variable. So as you update the pointes of the array, you get the results you see.</p>
 -1: <p>You are using a char pointer (char*) instead of a char.</p>

<p>When you say;</p>

<pre><code>response[idxUpd]  = assign;
</code></pre>

<p>you are assigning not the value but a pointer to that value. That points to <code>assign</code> for every element in <code>response[]</code>. Every <code>response[]</code> get the same pointer value, every <code>response[]</code> get the same value.</p>

<p>Use this:</p>

<pre><code>#define RespLength 10
int response[] = {0,0,0,0,0,0,0,0,0,0};
int idxUpd  = 0;

void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("Start");
}

void loop() {
  // put your main code here, to run repeatedly:
    int wkt = random(10, 99);
    response[idxUpd]  = wkt;

    Serial.print("Iteration "); Serial.print(idxUpd); Serial.print(" : ");
    for (int i=0;i&lt;RespLength;i++){
        Serial.print(response[i] );Serial.print(",");
    }
    Serial.println();
    delay(500);

    idxUpd++;
    idxUpd = idxUpd &gt;= 10 ? 0 : idxUpd;
}
</code></pre>

<p>I don't understand why you are converting a <code>int</code> to a <code>float</code>. That value doesn't change, so I omitted the <code>dtostr()</code> call.</p>
