std::string rule = "aa|b";
std::string curr;
std::vector<std::string> str;
int k = 0;
while (k < rule.size())
{
while (rule[k] != '|' )
{
curr.push_back(rule[k]);
k++;
}
str.push_back(curr);
curr.clear();
k++;
}
for (size_t i = 0; i < str.size(); i++)
{
std::cout << str[i] << "\n";
}
i want just to separate "aa" and "b" and have it in a vector as strings. It throws me this exception:
Unhandled exception at 0x7A14E906... An invalid parameter was passed to a function that considers invalid parameters fatal;