+ 9

Multi dimension Array size

Are there size restrictions on multi dimension Arrays in c++ on sololearn ? having issues keep getting: compilar error, when I make my array larger than: char X[4][12]{{bla, bla,........},{bla, bla,........}.....};

25th Jan 2018, 8:34 PM
Thor Westergren
Thor Westergren - avatar
6 Respostas
+ 8
if I out comment one of the arrays then it works https://code.sololearn.com/co9arFnQ93tZ/?ref=app
25th Jan 2018, 9:06 PM
Thor Westergren
Thor Westergren - avatar
+ 8
It works know, I have changed it from a constant to a none contact array
25th Jan 2018, 11:44 PM
Thor Westergren
Thor Westergren - avatar
+ 5
I've not hit a limit. Compiler errors will not be the indication of hitting a limit. You'd get a runtime error. You must be coding something wrong. Link the code so we can help.
25th Jan 2018, 8:59 PM
John Wells
John Wells - avatar
+ 4
one solution. fill in a[][] = {...} copy to fill in bigger array with for loops
25th Jan 2018, 9:37 PM
John Wells
John Wells - avatar
+ 3
If your number of initializations don't match the array bounds, it is an error.
25th Jan 2018, 9:35 PM
John Wells
John Wells - avatar
+ 1
same problem with me
26th Jan 2018, 12:22 PM
Mubarak Hussain
Mubarak Hussain - avatar