title: How can I add two strings?
body: <p>of size 5, that I want to add, according to some conditions that I will impose. Both strings are in the format 00:00. The first string (s1) represents a certain time of departure of a plane, the second one, is how delayed that departure will be...
  This is supposed to be done on a 24h clock.</p>
  
  <p>Let's say, for example
  s1=10:45 
  s1=01:50</p>
  
  <p>so first I have to add the 5 and the 0, see if there's a carry out and if the result is under 9, then add the 4 and the 5, see if the result is under 6. If it isn't I subtract 6 to the addition and add the carry out (1) to the 0 and the 1, then I'll add 1 to 0. </p>
  
  <p>5+0=5</p>
  
  <p>4+5=9   9-6=3  carry out:1</p>
  
  <p>0+1+1=2</p>
  
  <p>0+1=1</p>
  
  <p>12:35</p>
  
  <p>What I would like to obtain is s1=12:35</p>
  
  <p>I don't really get how pointers work... I've tried to understand them, but it was in vain...</p>
  
  <p>Can you help me?</p>
  
  <p>I have some ideas that I will post here:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  char*add_hours(char s1[], char s2[])
     int i;
     for(i=4; i&gt;3; i--){
      if(s1[i]+s2[i]&gt;9){
        strcpy(s1[i], ((s1[i]+s2[i])-10); 
        strcpy(s1[i-1], (s1[i-1]+1));
      } 
  ...
  }
  </code></pre>
  
  <p>the code goes on for a little while, but it repeats itself a few times. So I didn't think I needed to copy it all here. The problem is, he keeps telling me showing this warning:</p>
  
  <p><code>"warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast
  /usr/include/string.h:128: note: expected 'const char * _restrict_' but argument if of type 'int'</code></p>
  
  <p>And the same thing for the second argument, for every strcpy there is... I understand the error (I think) but I don't know how to correct it...</p>