would you please explain this line

hey, everyone, I'm going to use an alphabetic keypad for my project bu I couldn't understand this line of

buildStr[buildCount++] = (isalpha(key)) ? virtKey : key;

i approciate anyone could help me;

many thanks

buildStr[buildCount++] = (isalpha(key)) ? virtKey : key;

if (isalpha(key))
  buildStr [buildCount] = virtKey ;
} else {
  buildStr [buildCount] = key;
buildCount = buildCount + 1;

dear @AWOL
i couldnt undrstand this section,
would you please explain it too me?!

... = (isalpha(key)) ? virtKey : key;

many thanks

I just wrote the equivalent code.

Look up C ternary operator e.g. here

Google: ternary operator Arduino



Its a conditional expression, the expression equivalent of a conditional statement - only one of the then-part
and else-part is evaluated, depending on the condition.

Its powerful syntax, but use it wisely.

I just wrote the equivalent code.

I saw that, and I knew that it was the equivalent code. I suspect that OP didn't.

many thanks guys