How does fread really work?

There may or may not be any difference in performance. There is a difference in semantics. fread(a, 1, 1000, stdin); attempts to read 1000 data elements, each of which is 1 byte long. fread(a, 1000, 1, stdin); attempts to read 1 data element which is 1000 bytes long. They’re different because fread() returns the number … Read more

tech