how can i initialize a dynamically allocated array of characters so i don't get those weird characters?
<p>I want to use that array of characters in my game of "hangman" to view to tha user his current progress. </p>

<pre><code>#include &lt;iostream&gt;
#include "randword.h"
#include &lt;fstream&gt;
#include &lt;time.h&gt;
#include &lt;cstdlib&gt;

using namespace std;



int main()
{
InitDictionary();
string tixaio=Randomword();
int m = tixaio.length();
int guesses=8;
char *charptr= new char[m];





for(int aa=0;aa&lt;m;aa++){
charptr[aa]='-';

}

cout &lt;&lt; "The word now looks like this: "&lt;&lt;charptr;


}
</code></pre>

<p>As soon as i try to cout&lt;&lt; charptr my array i got the usual "---------" plus some weird characters. How can i prevent those characters from showing up??</p>
