Pointers related output
<pre><code>class student
{
 char *name;
 int I;
 public:
 student()
 {
  I=0;
  name=new char[I+1];
 }
 student(char *s)
 {
  I=strlen(s);
  name=new char[I+1];
  strcpy(name,s);
 }
 void display()
 {
  cout&lt;&lt;name&lt;&lt;endl;
 }
 void manipulate(student &amp;a,student &amp;b)
 {
  I=a.I+b.I;
  delete name;
  name=new char[I+1];
  strcpy(name,a.name);
  strcpy(name,b.name);
  }
 };
 void main()
 {
  clrscr();
  char *temp="Jack";
  student name1(temp),name2("Jill"),name3("John"),S1,S2;
  S1.manipulate(name1,name2);
  S2.manipulate(S1,name3);
  S1.display();
  S2.display();
  getch();
 }
</code></pre>

<p>i calculated the ouput of this code many times but couldn't understand it.
Output of this code is: 
                               Jill endline John</p>
