So I have a 2D Vector here that I want to assign a value num, I want to see which performs better fill vs memset() as C++ noob, I am actually having problem setting the proper code syntax as I just always get Segmentation fault when I do it.
vector<vector<int>> matrix(10, vector<int>(10000000));
int main()
{
int num;
cin >> num;
int i = 0;
for (auto &i : matrix)
{
fill(i.begin(), i.end(), num);
}
return 0;
}