void AFD::start(vector <string> lines){
if (std::find(lines.begin(), lines.end(), "a") != lines.end()) {
dfa = 1;
}
elseif (std::find(lines.begin(), lines.end(), "b") != lines.end()) {
dfa = 3;
}
// -1 is used to check for any invalid symbol
else {
dfa = -1;
}
}
The problem is when I try to access it in another method
int AFD::isAccepted(vector <string> lines){
int i;
// store length of string
int len = lines.size();
//int index = lines.at(i);
for (size_t i = 0; i < lines.size(); ++i) {
if (dfa == 0)
start(lines.at[i]);
}
}