title: How to make size output for array the same from inside function compared to main?
body: <p><code>sizeof(arr)</code> is returning different values from inside <code>main</code> and in <code>arr_size</code>. I expect the array to have all the same properties, I tested that the array isn't completely ruined by accessing a value which worked in all scopes, so I'm at a loss.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  void arr_size(std::string* arr_) {
      std::cout &lt;&lt; sizeof(arr_) &lt;&lt; std::endl; // 8
      std::cout &lt;&lt; arr[0] &lt;&lt; std::endl;
  }
  
  int main() {
      std::string arr[100] = {};
      arr[0] = &quot;iiiiiiiiiiiiiii&quot;;
  
      arr_size(arr);
  
      std::cout &lt;&lt; sizeof(arr) &lt;&lt; std::endl; // 3200
      std::cout &lt;&lt; arr[0] &lt;&lt; std::endl;
  }
  </code></pre>
  <p>As it shows: the <code>sizeof()</code> the array from within <code>arr_size</code> is <code>8</code>, while the expected size given from within <code>main</code> is <code>3200</code>.</p>
  <p>Edit, dereferencing <code>arr_</code> returns the size of std::string, which I would also like to understand.</p>