-
Code:
for(int i = 0; i < MaxPages; i++)
{
getline(input,address);
if(isAGet(address)==true)
{
extractTheRequest(address);
extractLocator(address);
locators[i] = extractLocator(address);
cout << locators[i] << endl;
}
}
Aparently the bool function of isAGet is not evaluating to true for some reason. This is really starting to get to me... I've tried so many variations and am having the toughest time with this.
-
What is the return type of isAGet()? If its not bool, it might be returning some other value as true instead.
-
When I have the if statement set to false it works. Look back at the first page to see the bool function isAGet.
Okay, I now have the thing working correctly. I am now moving on to counting how many times a page is shown. Here is the working function!!
Code:
getline(input, address);
for(int i = 0; i < MaxPages; i++)
{
if(isAGet(address) == false)
{
extractLocator(extractTheRequest(address));
cout << extractLocator(extractTheRequest(address)) << endl;
locators[i] = extractLocator(extractTheRequest(address));
getline(input, address);
}
}
-
Let's pay a little bit of attention, shall we?
Code:
for(int i = 0; i < MaxPages; i++)
{
getline(input,address);
if(isAGet(address)==true) //this can't be true because address isn't a get until we extract the request
{
string request = extractTheRequest(address);
//extractLocator(address); why do this line twice?
locators[i] = extractLocator(request);
cout << locators[i] << endl;
}
}
-
or what I could do, which is what I did, is this:
Code:
getline(input, address);
for(int i = 0; i < MaxPages; i++)
{
if(isAGet(extractTheRequest(address)) == true)
{
extractLocator(extractTheRequest(address));
cout << extractLocator(extractTheRequest(address)) << endl;
locators[i] = extractLocator(extractTheRequest(address));
getline(input, address);
}
}