title: Assign the value of a character array in pointer character c++
body: <p>I am creating a time class (string base) for my school project! I get a pointer character for the time!I have a function to normalize the time if it is weird.<br>
  in normalize function I have a character array to store the correct time but when I want to Assign the character array to the pointer character it is going false!</p>
  
  <pre><code>char st[10] = "", sh[3] = "", sm[3] = "", ss[3] = "";
  itoa(hour, sh, 10);
  itoa(minute, sm, 10);
  itoa(second, ss, 10);
  
  if(hour&lt;10){strcat(st, "0");}
  strcat(st, sh);strcat(st, ":");
  if(minute&lt;10){strcat(st, "0");}
  strcat(st, sm);strcat(st, ":");
  if(second&lt;10){strcat(st, "0");}
  strcat(st, ss);strcat(st, "");
  
  stime = st;
  </code></pre>
  
  <p><code>stime</code> is pointer character which save the time in class.<br>
  when I want to use value of <code>stime</code> I get very weird result. stime get the value of last class <code>stime</code>. for example I have this code:  </p>
  
  <pre><code>time a("1:50:0"), b("4:5:10");
  a.print();
  b.print();
  </code></pre>
  
  <p>but I get <code>04:05:10</code> for two classes and I don't know why!<br>
  If you need the rest of code I upload it here: <a href="https://drive.google.com/file/d/0BxEPT9Bd35V7TGttT3IzN2VmbG8/view" rel="nofollow">Google Drive link to file</a></p>