how to declare a 2D vector in c++ of size m*n with value 0
#include <vector>
int main() {
int m = 3; // Number of rows
int n = 4; // Number of columns
// Declare a 2D vector of size m x n with initial value 0
std::vector<std::vector<int>> matrix(m, std::vector<int>(n, 0));
// Access and modify elements of the 2D vector
matrix[1][2] = 42;
return 0;
}