Using a variable on the left

I am build a multi drum pad.
I want to have one button to change the note that is sent by each pad based on which pad was hit last.
Somehow I was hopping the variable name on the left side was variable, for example;
I have:

int noteA = 35;
int noteB = 38;
char hitnote = 'A';

note(hitnote)++;

note(hitnote) I want to become noteA
The new value of noteA would be 36

Then I can change hitnote to 'B' and increase noteB value.

I would:

Create an array containing your notes.

int notes[] = {35,38};

Create a variable which will hold the hitnote, making it an int will be easier than making it a char. we can just use 0 = A, 1 = B, 3 = C ...

int hitnote;

I'm guessing that hitnote will be detwermined by some sort of digitalRead so you will need a function to set hitnote.

hitnote = determineNoteHit();

Then you will need to to increment the value for that hit note.

notes[hitnote]++;

This is just one of many ways to skin your cat.

Hope it helps.

I think I understand.

If I start with an array as follows
int notes[] = {35,38};

If my hitnote is a value of 0
and

notes[hitnote]++
runs once

the array will look like
int notes[] = {36,38};

Cool Thanks for the help!

Correct.

Glad to help.