Tell me about float files and float files reader.

Asked By 10 points N/A Posted on -
qa-featured

Hi,

When I was searching the internet accidentally I found an article about float files reader. Then I searched related articles but couldn't get a clear idea. That makes me to find more about this. Could you please tell me simply what are the flat files and how to read them using a float file reader?

SHARE
Answered By 0 points N/A #168392

Tell me about float files and float files reader.

qa-featured

Wassup Payel, your question is indeed easy to solve, and I hope I will be able to help you as you require, the float files are files that define different character letters in Java e.g. int x, int y

 x = {1, 2, 3, 1e11};
   y = {1, 1.4142135623730951

They are mostly used in Java programming and they can be read from the reader when placed in a particular structure

This is how they should be structured;

void writefloat(float x, FILE *f) {
  fwrite((void*)(&x), sizeof(x), 1, f);
}

float readfloat(FILE *f) {
  float x;
  fread((void*)(&x), sizeof(x), 1, f);
  return x;
}

I hope this solves your query.

Thanks

Login/Register to Answer

Related Questions