Here's a working example. Look at how your code is different. Ask questions as required. :-)
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
std::vector<std::string> g_reserved
{
"the",
"quick",
"brown",
"fox",
"jumps",
"over",
"the",
"lazy",
"dog"
};
bool IsReserved(const std::string &s)
{
return g_reserved.end() !=
std::find(g_reserved.cbegin(), g_reserved.cend(), s);
}
int main()
{
std::cout << std::boolalpha
<< IsReserved("fox")
<< ' '
<< IsReserved("zebra")
<< std::endl;
return 0;
}