user85206: Here is my code:
char *StrAB[] = {"29 EC C7 C1", "69 5B C9 C2", "22 3B 83 34",  "12 BF BF 34", "C6 78 8E 2C" };  
void setup() {  
  Serial.begin(9600);  
}  
void loop() {  
  for (int i = 0; i < sizeof(*StrAB)+1; i++)   
  {  
    Serial.println(StrAB[i]);  
    delay(1000);  
  }  
  Serial.println(sizeof(*StrAB)+1);
  StrAB[sizeof(*StrAB)+1]= "00 00 00 00";
}  

I'm trying to append to the end of array of strings but it doesn't work? How can I delete a string from the array?

user7508: As stated by Sim Son in a comment, an array is a fixed-size data
structure in C++. You thus have to choose beforehand a suitable size,
and then keep track of how much of the array is actually used. For
example:
const int AB_max = 10;  // array capacity
const char *AB_str[AB_max] = {"29 EC C7 C1", "69 5B C9 C2",
    "22 3B 83 34",  "12 BF BF 34", "C6 78 8E 2C"};
int AB_count = 5;  // used slots

To add a string to this array, you write it to the next available slot.
But you have first to make sure there is still room available:
void AB_add(const char *s) {
    if (AB_count < AB_max)
        AB_str[AB_count++] = s;
}

If you want to remove an item (other than the last one), you will have
to shift all the following items down the array. The memmove()
function comes handy for this:
void AB_remove(const char *s) {
    // Find the index of s.
    int i;
    for (i = 0; i < AB_count; i++)
        if (strcmp(s, AB_str[i]) == 0) break;

    // Do nothing if not found.
    if (i == AB_count) return;

    // Move subsequent items down the array.
    memmove(&AB_str[i], &AB_str[i+1],
            (AB_count - (i + 1)) * sizeof *AB_str);
    AB_count--;
}

Note that moving these items down can be costly if the array is pretty
long. An array may then not be the best data structure for you. I
wouldn't worry though if it's just a dozen items or so.
Here is now a small test for all of the above:
void AB_print() {
    Serial.print("AB: ");
    Serial.print(AB_count);
    Serial.println(" items");
    for (int i = 0; i < AB_count; i++) {
        Serial.print("    ");
        Serial.println(AB_str[i]);
    }
    Serial.println();
}

void setup() {
    Serial.begin(9600);
    AB_print();
    AB_add("00 00 00 00");
    AB_print();
    AB_remove("12 BF BF 34");
    AB_print();
}

void loop() {}

Note that this is a very “C” style of doing things. If you want to go to
more idiomatic C++, you can start by putting everything that is named
with the prefix AB_ inside a class.
If you really want an array where you can vary the length, you may
allocate it with malloc() and resize it with realloc(). These
functions, however, are not very friendly to memory-constrained devices.
They are thus often avoided in the embedded world. They may also not
play well with code that uses new and delete, including library code
that you may not be aware of.

85206: <p>Here is my code:</p>
<pre class="lang-cpp prettyprint-override"><code>char *StrAB[] = {&quot;29 EC C7 C1&quot;, &quot;69 5B C9 C2&quot;, &quot;22 3B 83 34&quot;,  &quot;12 BF BF 34&quot;, &quot;C6 78 8E 2C&quot; };  
void setup() {  
  Serial.begin(9600);  
}  
void loop() {  
  for (int i = 0; i &lt; sizeof(*StrAB)+1; i++)   
  {  
    Serial.println(StrAB[i]);  
    delay(1000);  
  }  
  Serial.println(sizeof(*StrAB)+1);
  StrAB[sizeof(*StrAB)+1]= &quot;00 00 00 00&quot;;
}  
</code></pre>
<p>I'm trying to append to the end of array of strings but it doesn't work? How can I delete a string from the array?</p>
 7508: <p>As stated by Sim Son in a comment, an array is a fixed-size data
structure in C++. You thus have to choose beforehand a suitable size,
and then keep track of how much of the array is actually used. For
example:</p>
<pre class="lang-cpp prettyprint-override"><code>const int AB_max = 10;  // array capacity
const char *AB_str[AB_max] = {&quot;29 EC C7 C1&quot;, &quot;69 5B C9 C2&quot;,
    &quot;22 3B 83 34&quot;,  &quot;12 BF BF 34&quot;, &quot;C6 78 8E 2C&quot;};
int AB_count = 5;  // used slots
</code></pre>
<p>To add a string to this array, you write it to the next available slot.
But you have first to make sure there is still room available:</p>
<pre class="lang-cpp prettyprint-override"><code>void AB_add(const char *s) {
    if (AB_count &lt; AB_max)
        AB_str[AB_count++] = s;
}
</code></pre>
<p>If you want to remove an item (other than the last one), you will have
to shift all the following items down the array. The <code>memmove()</code>
function comes handy for this:</p>
<pre class="lang-cpp prettyprint-override"><code>void AB_remove(const char *s) {
    // Find the index of s.
    int i;
    for (i = 0; i &lt; AB_count; i++)
        if (strcmp(s, AB_str[i]) == 0) break;

    // Do nothing if not found.
    if (i == AB_count) return;

    // Move subsequent items down the array.
    memmove(&amp;AB_str[i], &amp;AB_str[i+1],
            (AB_count - (i + 1)) * sizeof *AB_str);
    AB_count--;
}
</code></pre>
<p>Note that moving these items down can be costly if the array is pretty
long. An array may then not be the best data structure for you. I
wouldn't worry though if it's just a dozen items or so.</p>
<p>Here is now a small test for all of the above:</p>
<pre class="lang-cpp prettyprint-override"><code>void AB_print() {
    Serial.print(&quot;AB: &quot;);
    Serial.print(AB_count);
    Serial.println(&quot; items&quot;);
    for (int i = 0; i &lt; AB_count; i++) {
        Serial.print(&quot;    &quot;);
        Serial.println(AB_str[i]);
    }
    Serial.println();
}

void setup() {
    Serial.begin(9600);
    AB_print();
    AB_add(&quot;00 00 00 00&quot;);
    AB_print();
    AB_remove(&quot;12 BF BF 34&quot;);
    AB_print();
}

void loop() {}
</code></pre>
<p>Note that this is a very “C” style of doing things. If you want to go to
more idiomatic C++, you can start by putting everything that is named
with the prefix <code>AB_</code> inside a class.</p>
<p>If you really want an array where you can vary the length, you may
allocate it with <code>malloc()</code> and resize it with <code>realloc()</code>. These
functions, however, are not very friendly to memory-constrained devices.
They are thus often avoided in the embedded world. They may also not
play well with code that uses <code>new</code> and <code>delete</code>, including library code
that you may not be aware of.</p>
