Similarly to the C strchr answer, In C++ you can construct a string and check the character against its contents:
#include
...
std::string("ABCDEFGIKZ").find(c) != std::string::npos;
The above will return true for 'F' and 'Z' but false for 'z' or 'O'. This code does not assume contiguous representation of characters.
This works because std::string::find returns std::string::npos when it can't find the character in the string.
Live on Coliru
Edit:
There's another C++ method which doesn't involve dynamic allocation, but does involve an even longer piece of code:
#include // std::find
#include // std::begin and std::end
...
char const chars[] = "ABCDEFGIKZ";
return std::find(std::begin(chars), std::end(chars), c) != std::end(chars);
This works similarly to the first code snippet: std::find searches the given range and returns a specific value if the item isn't found. Here, said specific value is the range's end.
Live on Coliru