Please anyone, Am having problems reading all lines of my txt file.
below is the function i wrote to read the data in the file and search thru them. but it appears to read just only the first line.. please anyone.
int stop_tag(string f_name, string u_file,string file_put)
f_out<<"Location of STOP condons TAG found at Locations :" <<endl;
ifstream yourfile (f_name);
while ( yourfile.good() )
for ( int p = 1; p < u_file.length(); p++)
I had to work and work to get your code to compile, This is formatted, and complies. I don't suggest you use it, but did you try to take out the break statement on line 21 yet ?
If the break is not at fault, it may be the logic.
cout your values for search, u_file.length, p, and any I missed to see if the values are what you expected. I can't compile your code as is and don't know what the input is so can't really help there.
thanks alot, but your coding only still shows the first line alone. my file has different lines of strings. what i want to do is search for all lines to get the positions of a particular string "TAG" as above. but all it seem to do is only search in the first line alone. i hope this gives you more understanding of what am trying to do.. i need help seriously.