you must know what type of data are written in that file
No, not really. You only need to know what type of data you want to work with from that file. If the number 7 is read into the stream I could make that a char, string, int, float, double, etc. ad infinum. It's read in as a void pointer so it can turn into just about anything you want it to be.EDIT: This seems like I'm being padantic but really, it's something worth noting to a new user.
@OP: You declare "array_len" as what ever data type you want it to be. It is a place holder since we don't know what you code looks like. That's how we demonstrate things like that around here.