fill array c 2b 2b

Solutions on MaxInterview for fill array c 2b 2b by the best coders in the world

showing results for - "fill array c 2b 2b"
Ryad
08 Jun 2020
1#include <iostream>
2#include <array>
3using namespace std;
4main () {
5  array<int,6> myarray;
6  myarray.fill(5);
7  cout << "myarray contains:";
8  for (int& x : myarray) { 
9      cout << ' ' << x; 
10  }
11  cout << '\n';
12  //myarray contains: 5 5 5 5 5 5
13  return 0;
14}
Luca
07 Jan 2017
1fill(arr,arr+n,0)