#include <algorithm> int default_value = 5; int size = 100; int array[size]; std::fill_n(array, size, default_value);
int arr[5] = {}; // results in [0, 0, 0, 0, 0]