Name: Anonymous 2007-03-02 19:21 ID:jQipi2LI
Guys, I fail hard at file I/O in C. What I'm trying to do is this:
Open the file
Read the first six bytes of the file
Compare it to blah, where blah is a character array
If it equals blah, do this stuff, otherwise
Shift forward one byte in the file and repeat.
The shifting part is kind of like a queue: basically, you go from FILE[0-5] to FILE[1-6] then FILE[2-7] and so on and so forth until EOF.
Can someone help me? In b4 forced indentation, Ruby on Rails, Opera, do your own homework, etc.
Open the file
Read the first six bytes of the file
Compare it to blah, where blah is a character array
If it equals blah, do this stuff, otherwise
Shift forward one byte in the file and repeat.
The shifting part is kind of like a queue: basically, you go from FILE[0-5] to FILE[1-6] then FILE[2-7] and so on and so forth until EOF.
Can someone help me? In b4 forced indentation, Ruby on Rails, Opera, do your own homework, etc.