Two dimensional array with vector

i made function, but I do not know how to test this.

#include <iostream>
#include <cassert>
#include <vector>

using namespace std;

vector<int> flatten(int a[100][200]) {
vector<int> v;
for (int i = 0; i < 100; ++i) {
for (int j = 0; j < 200; ++j) {
v.push_back(a[i][j]);
}
}
return v;
}

int main() { //test code

}
Exercise 10: Flatten (5 points)

vector flatten(int a[100][200]);
Write a function named flatten that takes a 2­dimensional array of integers with 100 rows and 200 columns and returns a vector that contains all of the array’s elements. Copy the values a row at a time. In other words, first copy row 0 into the vector, then row 1, then row 2, and so on. The declaration of flatten is given above.

This is whole question for that....
Topic archived. No new replies allowed.