Reading a file and splitting its contents and to store in an array
<p>I have this kind of file structure:</p>

<pre><code>0 0:124 25:11  
1 0:36 12:1 
</code></pre>

<p>with the interpretation:</p>

<pre><code>&lt;class&gt; &lt;array_index&gt;:&lt;class_occurrences&gt; &lt;array_index&gt;:&lt;class_occurrences&gt; ...
</code></pre>

<p>All the missing <code>array_index</code> should be initialized to zeros.</p>

<p>I want to identify the class and store the class_occurrences in an array.</p>

<p>So like I wanted to store class and its occurrences in a composite data structure(Array) class and its corresponding occurrences can be linked together say, line number in the file.</p>