C parse content of a file -



C parse content of a file -

i have parse content of file: string given input , have search each letter in string content of file. first tought was

while (readbytes = read(fd, buffer, sizeof(char)) > 0);

but how create sure access each char file? plenty using

for (i = 0; < size; i++) { parsechar(buffer[i]); }

what if content of file greater size?

don't read whole file if don't have to. read info read , phone call parsechar every character read. repeat until reach end of file.

while (readbytes = read(fd, buffer, buffer_length) > 0) { (i = 0; < readbytes; i++) { parsechar(buffer[i]); } }

c file

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -