#include <stdio.h>
#include <stdlib.h>

int main() {
  float pi;
  float n;

  // Should check for errors (e.g. file not found)
  // but keeping it short for lecture example

  // open in binary mode in addition to read mode
  FILE* output = fopen("temp.binary", "rb");

  // can read only one element, doesn't have to
  // be an array of values
  fread(&pi, sizeof(float), 1, output);

  fread(&n, sizeof(float), 1, output);

  printf("pi: %f n: %f\n", pi, n);


  fclose(output);
  return EXIT_SUCCESS;
}
