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,arra
For C arrays, you'll probably want to use memset. You've marked this as C++, though, so I feel obliged to give a C++ answer:
memset
std::vector> v(10, std::vector(10, 45));
This creates a std::vector of 10 std::vectors of size 10 with each element initialized to 45.
std::vector
See here for the ideone.