how to set or initialize default value for all elements of a table or 2d array or multdimentional array
<p>I want to set a default nonzero value for all elements of a table or 2d array. array[size]={12} sets first elements only 12 and others are all 0 in a row.But fill(array,array+size,12) sets all elements to 12 in a row only.I could't apply this for 2d array.Is there any way to do this using fill() or any way without direct initialization using double for loop</p>

<pre><code>#include &lt;iostream&gt;
#include&lt;algorithm&gt;
#include&lt;vector&gt;
#include&lt;stdlib.h&gt;
using namespace std;

int main()
{
   int arra[10][10];//declare 2d array

  for(int k=0;k&lt;10;k++)//takes k's value 10 for 10 rows
     fill(arra,arra+10,45);//select a row and set all columns to 45 didn't work

}
</code></pre>

<p>array initialization
 <a href="http://www.fredosaurus.com/notes-cpp/arrayptr/array-initialization.html" rel="noreferrer">http://www.fredosaurus.com/notes-cpp/arrayptr/array-initialization.html</a></p>