I am trying to convert the strings into inegers in this code:
Code:
string line;
string oct1;
string oct2;
string oct3;
string oct4;
int i = 0;
while ( ! in.eof())
{
while(getline(in,line))
{
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;
}
}
oct 1, 2, 3, and 4 I am trying to convert to an integer
When I use the atoi or the sscanf commands this error comes up