On 5/16/07, mahesh_anasuri <[EMAIL PROTECTED]> wrote:
> int main()
>  {
>      char *str = new char[12];
>      delete [] str;
>
>      char *test = new char[12];
>      strcpy(str, "surprise !");

Here you are writing to memory you don't own. From this point on all
bets are off, behavior is undefined.

>      cout << test << str;
>      delete [] test;
>
>  }
>


-- 
Tamas Marki

Reply via email to