Here is my Code as of now:
ifstream in("input.txt");
ofstream out("output.txt");
string line;
string octet1;
string octet2;
Type: Posts; User: carisma36
Here is my Code as of now:
ifstream in("input.txt");
ofstream out("output.txt");
string line;
string octet1;
string octet2;
OK it has been taken out but it still does not read in anything more than the first line
I don't understand your first sentence. I put the statement
int i = 0 in the inner loop.
I have a program that takes in ip addresses and breaks them up into 4 octets which are strings. Then I convert them into integers. I am having a problem with running the loop to take in each...
I am trying to convert the strings into inegers in this code:
string line;
string oct1;
string oct2;
string oct3;
string oct4;
int i = 0;
I formatted the code better, Sorry.
while(! in.eof() )
{
string line = "";
getline(in,line);
int i = 0;
while(line[i] != '.')
{
oct1 = oct1 + line[i];
Im using a getline with a '.' as the delimiter but I don't know how to get the rest of the ip address.
I can get the first octant but not the other 3
hey guys,
I have a question to ask
I am going to take in a file with a list of ip addresses
ex 130.5.3.6
128.10.5.0
i need a way to take in the entire line then break up the string...