I have written a function to parse string argument as a part of my project. Functionality is working all fine but I am getting one warning which says : C4018: '<' : signed/unsigned mismatch
. I don't know why this warning is coming. Can I get some help here. Thanks!
void FileMgr::parseCmdLineForTextSearch(std::string b)
{
int count=0;
int flag = 0;
patternVector.clear();
for (int i = 0; i < b.length(); i++) // this line where
// the warning line comes
{
if (b[i] == '"')
{
count++;
}
}
if (count == 2)
{
for (int i = 0; i < b.length(); i++)
{
if (b[i+1] == '"')
{
flag = 1;
tmp = b.substr(0, i+1);
tmp.erase(0, 1);
break;
}
else
{
continue;
}
}
std::istringstream iss(b);
std::string word;
while (iss >> word)
{ // for each word in b
if (word.find("*.") == 0)
{ // if it starts with *.
patternVector.push_back(word); // add it
}
}
if (patternVector.size() == 0)
{
patternVector.push_back("*.*");
}
isCorrect = true;
}
else
isCorrect = false;
}