Too many initializers for 'byte [26][8]'

Status
Not open for further replies.

Tanmay_Karmakar

New Member
I've been trying to work with a 2d array as mentioned 26 rows and 8 columns each. But the same error msg is poping up at compilation. What should I do?
 
Ex
.. .. if you can get past their egos !

MM
Exactly I tried the forum previously for another solution, I don't like it there.
However, I've attached the main part of the program and as for the array declaration and initialization I'm pretty sure there's no problem except if there's too many array elements to hold .
I've tried initializing the 2d array both globally and in a separate library file, the same results keep coming up.
 

Attachments

  • Screenshot_20200717-071133_1.jpg
    99 KB · Views: 439
Try,
Code:
char test[2][8] = {
                  1,2,3,4,5,6,7,8,
                  1,2,3,4,5,6,7,8
                  };

Mike.
Edit, what is the error message?
Edit2, Your binary numbers need 0b in front of them.
 
Last edited:
Try,
Code:
char test[2][8] = {
                  1,2,3,4,5,6,7,8,
                  1,2,3,4,5,6,7,8
                  };

Mike.
Edit, what is the error message?
Edit2, Your binary numbers need 0b in front of them.
I've tried with unsigned char data type, and just B instead of 0b just works fine.
 
Okay... Show me the array that holds the alphabet... It says there are too many items in the init part

ie..

someArray[2][2] = { 1,2,3,4,5 } ; <--- too may initialisers..
 


I’m willing to make a couple of bets.

Until you post all of your initialization code, you won’t get an answer. We’re just guessing.

Secondly, the problem is caused by a silly typo. Either mismatched braces or a missing (or extra) comma.

As mentioned, post your code with code tags.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…