that was an earlier post that I made, and I fixed the suggestions and my original problem, however, my program still isn't running successfully. I know the problem is in a while loop specifically this one in my GetIPs function
1 2 3 4 5 6 7 8 9 10 11 12 13
if(sortedWeblog.is_open())
{
int i = 0;
while(std::getline(sortedWeblog, line))
{
IP = line.substr(0,14);
if(IP != IPaddress[i-1])
{
IPaddress.push_back(IP);
}
i++;
}
}
I believe the problem has to do with the variable "i"
I have tried altering my loop countless times but I can't seem to fix it. Any help would be appreciated!
I am sorry but I will not explain the code because it looks very strange that you are using standard containers and at the same time do not know elementary operators.
I think you have to read some book on C++ for beginners.
|| is logical OR. The expression means push_back IP either when it is the first record (there is no yet any previous IP) or when the current IP is not equal to the previous IP.