Hi,
Is there any function in <fstream> that reads n bytes from a file into a variable (of any type like int, char, etc.). I mean something like fread() in C. I found several functions in my book (like read() or readsome()), but they all read in a buffer of char*. What do I do if I want to read in an int?
Thanx...



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.
But, isn't it a rather strange way of doing it? First reading something into a character, then casting it? Wouldn't it be easier to implement read(void*, int) in iostream?