This is a continuation of my previous post, but since the problem in question has changed, I thought I'd make a new post.
My original post was:
http://cboard.cprogramming.com/showthread.php?t=81136
My new question pertains to itsme86's recommendation of using the return value of fread() to determine the size of a text file. I want to do this because I'm storing the contents of a text file into a string, and then analyzing the string. It makes more sence to have the size (string[SIZE]) of the string dynamically allocated, as opposed to me hardcoding a guess (string[512]) into my program.
The problem I'm having is:
I've looked at the man page for fread(), and it's still confusing to me. I'm not how to utilize itsme86's recommended code below, as provided from my previouse thread.
If someone could help me understand this better, I'd appreciate it, also I appreciate itsme86's previous attempts to help me.Code:{
size_t data_len;
data_len = fread ( buf, 1, sizeof buf, in );
}
You guys rock for spending your time helping us newbs,
Thank you,
Michael