I got a binary file, i opened the file. I need to look for this "255.255.255.255", and then replace it with the user newly inserted IP...

I know there is something called seekp(), but it needs me to determine where to point in the file. I do not know yet. Once i find the spot 255.255... I will have to write from the iso::beg, right?

1. I can go through the file line by line by using getline()...Is there another solution?

2. Assume i went through the file & i found 255.255.255.255, to overwrite it do i t have to start from 2, or before 2? I guess ios::beg has to be involved in someway.

3.
Code:
ofstream file1;
file1.open("OutputTrial1.txt", ios::binary );
file1.write(temp,sizeof(temp));
file1.close();
In this line file1.open("OutputTrial1.txt", ios::binary ); OutputTrial1.txt is not binary, so how come we specified it as a binary in parameter two?

Regards