i have a question about c filestreams. there are so many differnt types of reading from/writing to files in c/c++ and i don't realy know what's best to use.
espacialy i noticed that there are fuctions like fread wich exspect a FILE * structure as filedescriptor and fuctions like read wich exspect an int.
i'd like to know what's the difference and how to deal with an filedescriptor of the type FILE* if i want to use it in a function that expects an int as fd (i.e. mmap).
Why would you want a buffered read versus a non-buffered read? If you need to read a byte of data when it's ready, use a non-buffered read (read() ). If you are reading data but are happy with the buffering the operating system supplies, use a buffered read (fread() ).