I'm a AP student at a high school loking for some help with a problem i'm having....
I was wonder how i would go about searching for text in a .txt file for .dat file without reading it into an array...
Thank You
-Argonic
Scott Miller
Printable View
I'm a AP student at a high school loking for some help with a problem i'm having....
I was wonder how i would go about searching for text in a .txt file for .dat file without reading it into an array...
Thank You
-Argonic
Scott Miller
This is one possible solution :
Read a char from the file. If the char is equal to the first char of the searchstring then add one to a counter. Read the next char and check it with the second(= counter) char of your searchstring. If the char is not equal reset counter to 0. If counter is equal to the length of your searchstring then you have found the string in the file.