There are at least a half a dozen ways to do this
and here's one...
In your program, setup a character pointer and an array
buffer of some size...
char *p, buf[1024];
...then open the file for reading...
fd = open(...)
...then read into the buffer...
while(read(fd, (void *)buf, sizeof(buf)-1) > 0)
{
...in this while loop you can...
p = buf;
for (i = 0; i < sizeof(buf), i++)
{
...in here you can process whatever "p" points to...
if(*p == '\0')
... p points to a null byte...
else
... p points to some data byte...
p++;
}
}