How to initialize 2D array with the same values ββin C ++
3 answers
Use std::vector
:
std::vector<std::vector<int>> table(20, std::vector<int>(20, 100));
Everything is done and "filled" in the ad. No more code needed.
-1
source to share