user13754: I've an array of type uint8_t* const with 6 items, defined like this 
uint8_t* const neighbourSet[] = {PEER1, PEER2, PEER3, PEER4, PEER5, PEER6};

Whereas each element in this array is static uint8_t defined like this
static uint8_t PEER1[] {0x86, 0xF3, 0xEB, 0x7A, 0xE8, 0x3B};
static uint8_t PEER2[] {0x86, 0xF3, 0xEB, 0x7A, 0xA1, 0x09};
static uint8_t PEER3[] {0x84, 0x0D, 0x8E, 0x03, 0x95, 0xED};
static uint8_t PEER4[] {0x84, 0x0D, 0x8E, 0x03, 0x99, 0xD5};
static uint8_t PEER5[] {0x80, 0x7D, 0x3A, 0xC5, 0x2B, 0x79};
static uint8_t PEER6[] {0x84, 0x0D, 0x8E, 0x03, 0x95, 0x1D};

When I do 
  Serial.print("size:");
  Serial.println(sizeof(neighbourSet));

I get size:24. I am expecting the size to be 6. could someone explain ? 
I don't want to hardcode the total number of PEER in a separate integer variable. I want my for loop to run through each element till the total size of array. 
    for (int i = 0; i < sizeof(neighbourSet); i++) {
         //do something for each PEER. 
         delay(50);
    }   


user13432: sizeof() gives the number of bytes. You are looking for membersof(). It is often defined as:
#define membersof(x) (sizeof(x) / sizeof(x[0]))

And in the example above:
for (int i = 0; i < membersof(neighbourSet); i++) {
     //do something for each PEER. 
     delay(50);
}  

For more practical C/C++ macro and type extensions please see the Cosa Types.h file. 

13754: <p>I've an array of type uint8_t* const with 6 items, defined like this </p>

<pre><code>uint8_t* const neighbourSet[] = {PEER1, PEER2, PEER3, PEER4, PEER5, PEER6};
</code></pre>

<p>Whereas each element in this array is <code>static uint8_t</code> defined like this</p>

<pre><code>static uint8_t PEER1[] {0x86, 0xF3, 0xEB, 0x7A, 0xE8, 0x3B};
static uint8_t PEER2[] {0x86, 0xF3, 0xEB, 0x7A, 0xA1, 0x09};
static uint8_t PEER3[] {0x84, 0x0D, 0x8E, 0x03, 0x95, 0xED};
static uint8_t PEER4[] {0x84, 0x0D, 0x8E, 0x03, 0x99, 0xD5};
static uint8_t PEER5[] {0x80, 0x7D, 0x3A, 0xC5, 0x2B, 0x79};
static uint8_t PEER6[] {0x84, 0x0D, 0x8E, 0x03, 0x95, 0x1D};
</code></pre>

<p>When I do </p>

<pre><code>  Serial.print("size:");
  Serial.println(sizeof(neighbourSet));
</code></pre>

<p>I get <code>size:24</code>. I am expecting the size to be 6. could someone explain ? 
I don't want to hardcode the total number of PEER in a separate integer variable. I want my for loop to run through each element till the total size of array. </p>

<pre><code>    for (int i = 0; i &lt; sizeof(neighbourSet); i++) {
         //do something for each PEER. 
         delay(50);
    }   
</code></pre>
 13432: <p><a href="https://en.cppreference.com/w/cpp/language/sizeof" rel="nofollow noreferrer"><code>sizeof()</code></a> gives the number of bytes. You are looking for <code>membersof()</code>. It is often defined as:</p>

<pre><code>#define membersof(x) (sizeof(x) / sizeof(x[0]))
</code></pre>

<p>And in the example above:</p>

<pre><code>for (int i = 0; i &lt; membersof(neighbourSet); i++) {
     //do something for each PEER. 
     delay(50);
}  
</code></pre>

<p>For more practical C/C++ macro and type extensions please see the Cosa <a href="https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Types.h#L165" rel="nofollow noreferrer">Types.h</a> file. </p>
