Reading characters displays all characters followed by some rubbish characters
<p>I have a program that reads a .DAT file that contains a list of:</p>

<pre><code>removepeer 452
addpeer 6576
removepeer 54245
</code></pre>

<p>At some point, it reads out rubbish text: H�</p>

<p>Here is a part of my code where I find fault in:</p>

<pre><code>getline(abc, info, '\n'); //data here displays pretty fine

int count = info.size();

char text[count];

for(int a=0; a&lt;count; a++){
    text[a] = data[a];
}
cout &lt;&lt; text &lt;&lt; endl; //Some rubbish text found in some printout!
</code></pre>

<p>It prints out the last line followed by some rubbish text</p>
