|
Pre-Load Arrays in EasyC, Possible?
Can anyone tell us if it is possible to pre-load your array with constant values in easyC? We want to create a lookup table and just need to create a single dimension array and load it with constants.
We have tried to define the constants as show in the screen shot. Look at "power[3]" It's a 1 x 4 array and when we set the value field to something like 0,0,0,0 we get an Error: 1 when we try and compile this.
If we leave it value field blank, such as the variable "sign[3]" then it will compile just fine.
We have tried formatting the value field:
0,0,0,0
{0,0,0,0}
(0,0,0,0)
The only thing that seems to work is leave it blank, then in code somewhere we have to do this:
power[0] = value0
power[1] = value1
power[2] = value2
power[3] = value3
(or write a loop to load up several constants...)
Is this the only way to pre-load the arrays in EasyC?
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here: Repository
Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
|