I wanted to declare a 2D array and assign values to it, without running a for loop.
I thought I could used the following idea
int array[5] = {1,2,3,
Like this:
int main() { int arr[2][5] = { {1,8,12,20,25}, {5,9,13,24,26} }; }
This should be covered by your C++ textbook: which one are you using?
Anyway, better, consider using std::vector or some ready-made matrix class e.g. from Boost.
std::vector