I want to read some data from the file, the data will have different sizes at different times.
If I use the below code, then:
char dataStr[256];
fread(dataStr, strlen(dataStr), 1, dFd);
fread
is returning 0 for the above call and not reading any thing from the file.
But, if I give size as 1 then it successfully reads one char
from the file.
What should be the value of size argument to the fread()
function when we do not know how much is the size of the data in the file?