Hi,
I have a variable declared as the following:
char * buf;
I then get a size of a file and allocate memory and point the buf to
it. Here is where I am having a problem. I want to know how I can read
the buf in chunks... so here is a description of what i am looking
for.:
while the end of the buffer hasn't been reached{
send 100 characters of the buf to some function
then send the next 100 ...
}repeat this until the end of the buf
I was originally trying to do:
while (!feof(filename)){
read(filename, buf, 100,0);
process(buf);
}
but for some reason the look never ended. I work with both binary and
ascii files so I am not sure if that has anything to do with.
Any suggestions for the buffer problem??
Thanks
J