-3
int "buttons"[6];

int "buttons"[0] = 2;

When i upload the code to the board it says:

exit status 1
expected unqualified-id before string constant
1
  • 8
    please, take a coding course
    – Juraj
    Aug 28, 2018 at 18:55

1 Answer 1

2
  1. "buttons" is not a valid identifier (i.e., not a valid variable name) because it does not start with a letter or underscore.

  2. You should not repeat the type when you want to refer to the already-declared variable.

You declare the variable like:

int buttons[6];  // A 6-element array of integers

And if you want to refer to a specific element in the array:

buttons[0] = 2; // Let the first element of the array be the value 2.

Not the answer you're looking for? Browse other questions tagged or ask your own question.