Help in understanding this code line

Dear all, I downloaded the Keypad library, and for my project I need to use the Dynamic Keypad (numbers & letters),

In the following code downloaded, I did not understand this line:

char* keypadMap = (alpha == true) ? makeKeymap(alphaKeys) : makeKeymap(numberKeys); can someone pls explain since I never saw such coding.


This is a trinary operator

test ? true value : false value


if alpha == true then keypadMap = makeKeymap(alphaKeys) if alpha == false then keypadMap = makeKeymap(numberKeys)

equivelant to

if (alpha)
  keypadMap = makeKeymap(alphaKeys)
  keypadMap = makeKeymap(numberKeys)


tnx mate