Hi,
please see this code
Code:
#include <iostream>
using namespace std;

int main(void)
{
	 char *pA=new char[10]="Raj"; 
	 char *pB; 
	 cout<<pA<<endl;
	 pB=new char[10];
	 char *q = pB;
	 while(*pB++ = *pA++); 
	 *pB = '\0'; 
	 cout<<q<<endl; 
	 return 0;
}
This code works fine and the out put is
Raj
Raj
string copy happens correctly.
(I am running this code in .NET 2005).

But if I change a little like below the code is giving exception.
Code:
#include <iostream>
using namespace std;

int main(void)
{
	 char *pA=new char[10]="Raj"; 
	 char *pB; 
	 cout<<pA<<endl;
	 pB=new char[10]= "aaa"; // This is the changed line 
	 char *q = pB;
	 while(*pB++ = *pA++); 
	 *pB = '\0'; 
	 cout<<q<<endl; 
	 return 0;
}
please clarify.