title: c++11 array passing to function error
body: <p>I am trying out a c++11 array by following along with <a href="http://www.youtube.com/watch?v=czrbhZjp4JA&amp;list=PL3345A50B73C26A6F" rel="nofollow">this</a> YouTube video tutorial series.  Though I am not very skilled in using my IDE's, I have both of my IDE's, Eclipse and Codeblocks, set to have the compiler follow the C++0x ISO language standard [-std=c++0x] which at least allows them to understand the syntax of a c++11 array, such as <code>array &lt;double, 5&gt; rainfall;</code>  Both are responding in the same way.  The following code I have written passes this array to a function which prints it out.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;array&gt;
  
  using namespace std;
  
  void printArray(double[], int);
  
  int main()
  {
      array &lt;double, 5&gt; rainfall;
  
      rainfall[0] = 2.3;
      rainfall[1] = 0.3;
      rainfall[2] = 0.0;
      rainfall[3] = 4.1;
      rainfall[4] = 0.5;
  
      printArray(rainfall, 5);
  
      return 0;
  }
  
  void printArray(double array[], int size)
  {
      for(int i = 0; i &lt; size; i++)
      {
          cout &lt;&lt; array[i] &lt;&lt; " | ";
      }
  }
  </code></pre>
  
  <p>With a non-c++11 array, such as <code>double rainfall[5]</code> this works fine, but with <code>array &lt;double, 5&gt; rainfall</code> there is an error which reads <code>cannot convert 'std::array&lt;double, 5u&gt;' to 'double*' for argument '1' to 'void printArray(double*, int)</code>  The video I am following uses the same code, yet does not receive this error.</p>