Code:
while(! in.eof() )
{
string line = "";
getline(in,line);
int i = 0;
while(line[i] != '.')
{
oct1 = oct1 + line[i];
i++;
}
cout<<oct1<<" ";
i++;
while(line[i] != '.')
{
oct2 = oct2 + line[i];
i++;
}
cout<<oct2<<" ";
i++;
while(line[i] != '.')
{
oct3 = oct3 + line[i];
i++;
}
cout<<oct3<<" ";
i++;
while(i != line.length())
{
oct4 = oct4 + line[i];
i++;
}
cout<<oct4<<endl;
}
This is the code I have so far. It takes in each octed but it only does it for one line. Why is that? shouldn't it be doing it for every line(every IP Address)?