user24275: I am trying to find out the size of an array like this:
    String days[3] = { "Mon", "Tue", "Wed" };
Serial.printf("Size of array: %2d\n", sizeof(days));
for (int i = 0; i < sizeof(days); i++) {
    Serial.print(days[i]);
}

The result of the code above is 36 which is incorrect.
Do I have any other options considering that I don't know the size of the array to begin with?

user368: No, the result is correct, you're just interpreting it incorrectly. If you want the number of elements in a statically-allocated array use:
sizeof(somearray) / sizeof(somearray[0])


24275: <p>I am trying to find out the size of an array like this:</p>

<pre><code>    String days[3] = { "Mon", "Tue", "Wed" };
Serial.printf("Size of array: %2d\n", sizeof(days));
for (int i = 0; i &lt; sizeof(days); i++) {
    Serial.print(days[i]);
}
</code></pre>

<p>The result of the code above is 36 which is incorrect.</p>

<p>Do I have any other options considering that I don't know the size of the array to begin with?</p>
 368: <p>No, the result is correct, you're just interpreting it incorrectly. If you want the number of elements in a statically-allocated array use:</p>

<pre><code>sizeof(somearray) / sizeof(somearray[0])
</code></pre>
