title: Pointer address is not incrementing
body: <p>I have already implemented some of the recommendations before in <a href="https://codereview.stackexchange.com/questions/16301/how-to-improved-and-optimized-my-squeeze-function">Code Review</a>. I also improved my code by using pointers. However, what is wrong with address incrementation part below <code>squeezed_str++</code>? It seems that address is not incrementing. Please advise.</p>
  
  <p>PS. substring() function is working. :)</p>
  
  <pre><code>char *squeeze (char *str, int start_index, int end_index, char *ref_str) {
       char *substr;
       substr = malloc (sizeof (*substr));
       if (substr == NULL) {
            printf ("Unable to allocate memory.\n");
            exit (EXIT_FAILURE);
       }
  
       char *squeezed_str;
       squeezed_str = malloc (sizeof (*squeezed_str));
       if (squeezed_str == NULL) {
            printf ("Unable to allocate memory!\n");
            exit (EXIT_FAILURE);
       }
  
       substr = substring (str, start_index, end_index);
       int substr_len = strlen (substr);
       int refstr_len = strlen (ref_str);
  
       char chr1, chr2; chr1 = chr2 = '\0';
  
       for (int i = 0; i &lt; substr_len; i++) {
            chr1 = *(substr+i);
            for (int j = 0; j &lt; refstr_len; j++) {
                 chr2 = *(ref_str + j);
                 if (chr1 == chr2) {
                      break;
                 }
            }
            if (chr1 != chr2) {
                 *squeezed_str = *(substr+i);
                 squeezed_str++;
            }     
       }
  
       return squeezed_str;
   } /* end of squeeze() */
  </code></pre>