June 13th, 2003, 01:41 PM
extremely easy... string function
I just need to loop through a long string to analyze it.
I read a file into char massive;
then I need to:
read 41 bytes,,, trash them
read 3 bytes compare them
read until end of line
loop until end of the variable.
whats the string function I need
June 13th, 2003, 02:07 PM
So basically you want to read in a line and pull out characters 41,42, and 43.
#define MASSIVE_SIZE 1024 // or whatever massive means here
// code placed in a function to emphasize that massive probably does not belong on the stack.
void foo(FILE *fp)
substring = '\0'; // need to manually add the null-terminator
June 13th, 2003, 02:38 PM
I was reading 41 characters, reading 3 characters comparing and updating a counter then reading to /n
with this method I was doing many reads in the loop.
now I would like to read the whole file 21000000 bytes (massive) into a variable and then loop through it as above.. each line has 41 characters of junk 3 lines of info and the rest junk.