user16124: Hello  have an array of strings that loads strings from a txt file on an sd card.
The txt file on the SD card can change from time to time(not while the Arduino is running).I want to be able to get the amount of elements in the array after the txt file has been loaded into the array. The txt file has lines of txt in it. Each line in the file is put into a string in the array. I want to be able to get the amount of elements in the array how can I do this?

user4143: You can't. That concept does not exist in C.
An array has a fixed size - as such you know how many elements are in it, since that is the number of elements you created it with.
String myStrings[4];

That is an array of 4 String objects. It has 4 elements. It will always have 4 elements.

user20570: numElements = (sizeof(array) / sizeof(array[0]));

16124: <p>Hello  have an array of strings that loads strings from a txt file on an sd card.
The txt file on the SD card can change from time to time(not while the Arduino is running).I want to be able to get the amount of elements in the array after the txt file has been loaded into the array. The txt file has lines of txt in it. Each line in the file is put into a string in the array. I want to be able to get the amount of elements in the array how can I do this?</p>
 4143: <p>You can't. That concept does not exist in C.</p>

<p>An array has a fixed size - as such you know how many elements are in it, since that is the number of elements you created it with.</p>

<pre><code>String myStrings[4];
</code></pre>

<p>That is an array of 4 String objects. It has 4 elements. It will always have 4 elements.</p>
 20570: <p>numElements = (sizeof(array) / sizeof(array[0]));</p>
