title: How to read a binary file to calculate frequency of Huffman tree?
body: <p>I have to calculate frequency of Huffman tree from a "binary file" as sole argument. I have a doubt that binary files are the files which contains "0" and  "1" only.</p>
  
  <p>Whereas frequency is the repetition of the number of alphabets (eg, abbacdd here freq of a=2, b=2 ,c=1, d=2).
  And my structure must be like this:</p>
  
  <pre><code>struct Node
  {
  unsigned char symbol;   /* the symbol or alphabets */
  int freq;               /* related frequency */
  struct Node *left,*right; /* Left and right leafs */
  };
  </code></pre>
  
  <p>But i not at all understand how can i get the symbol and from ".bin" file (which consists of only "0" and "1") ?</p>
  
  <p>When i try to see the contents of a file i get:</p>
  
  <pre><code>hp@ubuntu:~/Desktop/Internship_Xav/Huf_pointer$ xxd -b out.bin 
  0000000: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  0000006: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  000000c: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  0000012: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  0000018: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  000001e: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  0000024: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  000002a: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  0000030: 00000000 00000000 00000000 00000000 00000000 00000000  ......
  .........//Here also there is similar kind of data    ................
  00008ca: 00010011 00010011 00010011 00010011 00010011 00010011  ......
  00008d0: 00010011 00010011 00010011 00010011 00010011 00010011  ......
  00008d6: 00010011 00010011 00010011 00010011 00010011 00010011  ..... 
  </code></pre>
  
  <p>So , <strong>I not at all understand where are the frequencies and where are the symbols. How to store the symbols and how to calculate frequencies. Actually after having frequencies and symbols i will create HUffman tree using it.</strong></p>