|
|
View previous topic :: View next topic |
Author |
Message |
dxrose86
Joined: 28 Feb 2009 Posts: 5 Location: Taunton Ma
|
multi dimensional array initialization |
Posted: Wed Feb 24, 2010 2:48 pm |
|
|
Hello, has anyone used constant multidimensional arrays?
compiler v 4.099
Pic 18f26k20
Code: |
const int gtable [][]= {
{0x05,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff},
{0x01,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff},
{0x04,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff},
{0x02,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff}
};
|
error 86 looking for = ?
Thank You _________________ Micro-guy |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 24, 2010 2:51 pm |
|
|
Give it the number of rows and columns. Then it will compile:
Code: |
const int gtable [4][17]= {
|
|
|
|
RoGuE_StreaK
Joined: 02 Feb 2010 Posts: 73
|
|
Posted: Wed Feb 24, 2010 6:41 pm |
|
|
I don't know if it's relevant or even correct, but I was having issues with a similar thing recently, and the method of declaration that worked for me was without the separating brackets and commas; ie: Code: | const int gtable [4][17]= {
0x05,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff
0x01,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff
0x04,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff
0x02,0x37,0x51,0x65,0x77,0x87,0x95,0xa2,0xae,0xba,0xc5,0xd0,0xda,0xe4,0xed,0xf7,0xff
}; |
Don't know why this was, or whether it just happened to coincide with another issue, but when I did it this way it worked. I've got some sound waveforms stored this way with thousands of samples, and they are now working fine. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|