Hopefully a simple question of syntax...
I have a class (Library) that I need two instances in my program but initialized with different values - arrays of non-consecutive numbers. I want to pass those arrays in when I init the instances. I am getting errors about 'incompatible types' int* and int.
What I am trying to do seems pretty basic. Is it just the wrong syntax? I can see some hack-around solutions but would like to understand how to do this right.
thanks! --Roy
In my sketch:
int LC[] = {0,1,2,3,4,5,6,7,16,17,18,19};
leftCircle.init('L',LC, 1, 25);
The .h file
#define CircleSmall_h
#include "WProgram.h"
class CircleSmall
{
public:
int direction;
int delayPeriod;
int[] lightArray;
CircleSmall();
void init(int, int[], int, int);
};
#endif
The implementation (.cpp):
#include "CircleSmall.h"
CircleSmall::CircleSmall(){
//
}
void CircleSmall::init(int i, int L[] , int d, int p){
id = i;
lightArray = L;
direction = d;
delayPeriod = p;
}