First of all, you can make
Code:
for (int x = 0; x < 10; x++) {
buttons[x] = false;
}
into this:
Code:
buttons = {0}; //This fills the array with 0's, which is equivalent to false.
Secondly, I am partial against using the "<=" operator in a for loop; I suggest just sticking with "<".
*victor points to the pointer to a pointer to an array of pointers to Victor objects. Now, what many C/C++ novices overlook is the fact that the array and pointer notations are interchangeable. So, let's see this example:
Code:
int foo[10] = {0};
for(int i = 0; i < 10; i++)
foo[i] = i;
//Is the same as this:
for(int i = 0; i < 10; i++)
*(foo+i) = i;
So, that being said, look at how you declared your Victor array. I don't think you are doing what you are trying to do.
I would do:
Code:
Victor **victors;
//All the other stuff...
JoystickInput::JoystickInput(Joystick * joy, Victor **vicArray) {
joystick = joy;
buttons = {0};
victors = vicArray;
}
//Then when you declare that array that you pass in:
Victor *drivers = new Victor[8];
//Fill the array like drivers[0] = new Victor();
//Then pass it into the function.
JoystickInput(joy, &drivers);
Hopefully that helps. I might have made a simple mistake here or there, but keep in mind that I've been almost exclusively been programming in C this year.