populate an array c++ code example
Example: popualte an array c++
const int arraysize = 10;
int a[arraysize] = {1, 2, 3, 6, 8, 5, 5, 0, 2, 7};
int b[arraysize] = {1, 2, 3};
int c[arraysize] = {};
for(int i = 0; i < arraysize; ++i) {
std::cout << a[i] << ' ' << b[i] << ' ' << c[i] << std::endl;
}
This outputs
1 1 0
2 2 0
3 3 0
6 0 0
8 0 0
5 0 0
5 0 0
0 0 0
2 0 0
7 0 0