<p>For C-style strings, the convention is that a string ends with a <code>0</code>.  This means that you can't have a <code>0</code> in a C-style string.</p>

<p>If you have a <code>double</code> value that you don't need, you can store that at the end of your array, and check for it.  For example, you might be able to use <code>0</code>, or NaN (Not a number).  See how to use NaN in <a href="https://stackoverflow.com/questions/1923837/how-to-use-nan-and-inf-in-c">C</a> or in <a href="https://stackoverflow.com/questions/235386/using-nan-in-c">C++</a>.  If you do use a non-NaN number as a sentinel, you should read <a href="http://arxiv.org/abs/cs.PL/0701192" rel="nofollow noreferrer"><em>The pitfalls of verifying floating-point computations</em></a> before you compare floating point numbers for equality.</p>

<p>Of course, since you're using C++, and you don't want to remember your array's size, you should think about using <code>std::vector&lt;double&gt;</code> instead.</p>
Compact pointer notation with doubles
<p>Quick question.  When you are accessing a character array, I know you can set the pointer to the first element in the array, and use a while look and do something like </p>

<pre><code>while (*ptr != '\0') {
   do something
}
</code></pre>

<p>Now is there a double or int equivalent?  </p>

<pre><code>#define ARRAY_SIZE 10
double someArray[ARRAY_SIZE] = {0};
double *ptr = someArray;
// then not sure what to do here?  I guess I am looking for an equivalent of the above while loop, but don't want to just do:
for (int i = 0; i &lt; ARRAY_SIZE); *ptr++) 
cout &lt;&lt; *ptr;
</code></pre>

<p>thanks!</p>