How do you pass an enum by reference?

Posted by Darkenor on Stack Overflow See other posts from Stack Overflow or by Darkenor
Published on 2011-03-05T23:54:51Z Indexed on 2011/03/06 0:11 UTC
Read the original article Hit count: 114

Filed under:
|

I have an enum with four keys I'm taking as input for an interface program and I'd like to pass the enum by value to the interface function, which has become quite long. The enum is like this:

enum MYKEYS {
  W, S, O, L
};

There's also a boolean array that I have to pass by reference, which is also a little tricky.

bool key[4] = { false, false, false, false };

Does anyone know the proper syntax to pass both of these as reference in a function, similar to:

function(int & anintreference);

© Stack Overflow or respective owner

Related posts about c++

Related posts about enums