+ 4
how to make this matrix work?
i think i dont know how to initialize it https://code.sololearn.com/ciBqs149Jum5/?ref=app
2 Answers
+ 9
First thing I notice straight away is that your inner `for` loop is missing braces `{` and `}`.
One very good way to lower the chances of messing up braces is to always indent your code correctly. Indentation is not obligatory in C/C++ but it makes code much more readable and maintainable.
Edit: done some corrections, now it seems to work.
for(int i=0;i<5;i++) {
for(int j=0;j<=5;j++) {
a[i][j] == chance;
cout << a[i][j] << " ";
}
cout << endl;
}
+ 3
thanks