title: Printing float array using for loop and pointers
body: <p>I'm starting out in CPP on arrays and pointers. </p>
  
  <p>I'm trying to print a float array but I'm getting past the float array.</p>
  
  <p>How can I stop printing the float array once i hit the end?</p>
  
  <pre><code>// all about arrays and pointers
  
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main (int argc, char * argv []) {
  
      float inputs1 [] = { 12 };
      float inputs2 [] = { 12 , 4 };
  
      cout &lt;&lt; "sizeof(inputs1)" &lt;&lt; sizeof(inputs1) &lt;&lt; endl;
      cout &lt;&lt; "sizeof(inputs2)" &lt;&lt; sizeof(inputs2) &lt;&lt; endl;
  
      float *it = inputs2;
      cout &lt;&lt; *it &lt;&lt; endl;
      it++;
      cout &lt;&lt; *it &lt;&lt; endl;
      cout &lt;&lt; endl;
  
      cout &lt;&lt; "sizeof(inputs1): " &lt;&lt; sizeof(inputs1) &lt;&lt; endl;
      cout &lt;&lt; "sizeof(inputs2): " &lt;&lt; sizeof(inputs2) &lt;&lt; endl;
      cout &lt;&lt; "start address: " &lt;&lt; &amp;inputs2 &lt;&lt; endl;
      cout &lt;&lt; "end address: " &lt;&lt; &amp;inputs2[sizeof(inputs2)] &lt;&lt; endl;
  
      for (float *it2 = inputs2; it2!=&amp;inputs2[sizeof(inputs2)]; it2++) {
          cout &lt;&lt; "it2 " &lt;&lt; it2 &lt;&lt; endl;
          cout &lt;&lt; "*it2 " &lt;&lt; *it2 &lt;&lt; endl;
      }
  }
  </code></pre>