HEAP COORUPTION DEFINED - what is it?
<p>I have got class longMath, and write for it a function </p>

<pre><code>class longMath{
protected:
    char* str;
    int size;

protected:
.....

};



void longMath::get() throw (char* ){
    char temp[100];
    cin.getline(temp,100,'\n');
    cout&lt;&lt;strlen(temp)&lt;&lt;endl;
    for (int i=0;i&lt;strlen(temp);i++){
        if (switcher(temp[i]) == false) 
        {   throw ("Wrong imput!\n");
            cout&lt;&lt;"Wrong imput!";
        }
    }
    str = new char [strlen(temp+1)];
    strncpy(str,temp,strlen(temp));
    str[strlen(temp)]='\0';
    size=strlen(temp);
}
</code></pre>

<p>IN main file i have:</p>

<pre><code>longMath h;
    h.get();
    h.print();
</code></pre>

<p>it compiles fine, while debugging I have checked meanings of my classes members, but after pressing enter to exit from console, I have "HEAP COORUPTION DEFINED"
Haw can I solve this?</p>
