title: How to read in object files in C?
body: <p>Let's say there's an object file input.obj. In the terminal, if I do "cat input.obj," it returns some random characters like "???A?J." But when I "hexdump" it, it shows the values I want to read in into my program.</p>
  
  <p>I read in this obj file into program.c, firstly by opening it using fopen and read byte by byte using fgetc. However, it is actually reading the contents as shown in "cat input.obj," whereas I want it to read the actual contents as in hexdump. Any ideas?</p>
  
  <p>Code snippet (from poster's comment):</p>
  
  <pre><code> char *filename; 
   FILE *f; 
   char c; 
   f = fopen(filename, "r"); 
   c = fgetc(f);
  </code></pre>