title: Read binary file,cannot execute binary file: Exec format error
body: <p>My code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define FILENAME "m_6"
  
  int main() {
     float f;
     FILE * file;
     // read values
     if ( ! (file = fopen(FILENAME,"r")))
        return 1;
     while ( fread( &amp;f, sizeof(float), 1, file ))
        printf("%e\n", f);
     fclose( file );
  }
  </code></pre>
  
  <p>When I compile with gcc <code>gcc -c n1.c -o n1</code></p>
  
  <p>and try to run it I got</p>
  
  <pre><code>bash: ./n1: cannot execute binary file: Exec format error
  </code></pre>
  
  <p>File m_6 and n1.c were executed on the same machine.</p>
  
  <pre><code>3.13.0-76-generic #120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  </code></pre>
  
  <p>How to solve this?</p>