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 -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -