function Prototype

Declare a function prototype to compareInputWithMasterKey. This function will take an integer input, keyNum, and provide an integer output.

(is the following correct? I am not familiar with function prototypes) if not please help with an example.

int compareInputWithMasterKey( int x, keyNum, int y);

that looks right

Hum

Out of curiosity, try:

int compareInputWithMasterKey( int, int, int);

I’d have said, based on the text description:

int compareInputWithMasterKey( int keyNum ) ;

Although the original description is somewhat ambiguous. Maybe it should have been:

This function will take a SINGLE integer input, keyNum, and provide an integer output.

The function prototype is basically the first line of the function definition.

E.g. for digitalRead and digitalWrite, the function definitions are

int digitalRead(uint8_t pin)
{
  ...
  ...
}

void digitalWrite(uint8_t pin, uint8_t val)
{
  ...
  ...
}

and the prototypes are basically

int digitalRead(uint8_t pin);
void digitalWrite(uint8_t pin, uint8_t val);

You can leave the variabele names out as done in Arduino.h. I prefer not to do so as the above makes straight away clear what the arguments are supposed to indicate while in the below does not (you don't know based on that if the first arguments of digitalWrite is the value or the pin)

void digitalWrite(uint8_t, uint8_t);
int digitalRead(uint8_t);

Spanish_Good:
Declare a function prototype to compareInputWithMasterKey. This function will take an integer input, keyNum, and provide an integer output.

Reads like a homework problem.

gfvalvo:
Reads like a homework problem.

That had crossed my mind. Also, since integer is not a C++ datatype, all the answers which have assumed it was a C++ question may be wrong.